Merge lp:~giuseppeterrasi-deactivatedaccount/ubuntu-it-ask/1022223 into lp:~ubuntu-it-ask/ubuntu-it-ask/dev

Proposed by Giuseppe Terrasi
Status: Merged
Merged at revision: 58
Proposed branch: lp:~giuseppeterrasi-deactivatedaccount/ubuntu-it-ask/1022223
Merge into: lp:~ubuntu-it-ask/ubuntu-it-ask/dev
Diff against target: 118 lines (+22/-11)
5 files modified
00-FIXME (+5/-1)
00-README (+8/-1)
forum_modules/pgfulltext/handlers.py (+2/-2)
forum_modules/pgfulltext/pg_fts_install.sql (+4/-4)
settings_local.py (+3/-3)
To merge this branch: bzr merge lp:~giuseppeterrasi-deactivatedaccount/ubuntu-it-ask/1022223
Reviewer Review Type Date Requested Status
Ubuntu-it Ask Pending
Review via email: mp+118262@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '00-FIXME'
2--- 00-FIXME 2012-08-03 19:06:00 +0000
3+++ 00-FIXME 2012-08-05 06:03:19 +0000
4@@ -18,7 +18,7 @@
5
6 = settings_local.py =
7
8-Disabilitati i seguenti moduli, di default abilitati: mysqlfulltext, localauth, oauthauth, facebookauth
9+Disabilitati i seguenti moduli, di default abilitati: mysqlfulltext, localauth, oauthauth, facebookauth, sphinxfulltext
10
11 = forum/skins/light/media/js/wmd/wmd.js =
12
13@@ -51,3 +51,7 @@
14
15 = forum/templatetags/extra_tags.py =
16 FIXME: proporre cambiamento upstream come da lp:~giuseppeterrasi/ubuntu-it-ask/l18ned
17+
18+= forum_modules/pgfulltext =
19+
20+sostituito "english" con "italian"
21
22=== modified file '00-README'
23--- 00-README 2012-07-20 20:58:48 +0000
24+++ 00-README 2012-08-05 06:03:19 +0000
25@@ -27,13 +27,14 @@
26 c) timezone in Europe/Rome
27 d) languages in IT
28 e) DJANGO_VERSION = 1.3
29- f) DISABLED_MODULES add 'mysqlfulltxt', 'localauth'
30+ f) DISABLED_MODULES add 'mysqlfulltxt', 'localauth' 'sphinxfullsearch'
31 g) CACHE_BACKEND = 'memcached://<server-address>:<port>/ with the correct path.
32 5) python manage.py syncdb --all (no create super user)
33 6) python manage.py migrate forum --fake
34 7) cp -R locale l it
35 8) python manage.py makemessages -l it
36
37+
38 ** Note: an example of settings_local.py with right database settings (line 27): http://bazaar.launchpad.net/~ubuntu-it-ask/ubuntu-it-ask/trunk/view/head:/settings_local.py
39
40
41@@ -52,6 +53,12 @@
42
43 (if you need a dump of this table, please use: pg_dump ubuntu-it-chiedi --clean -O -t forum_keyvalue -f forum_keyvalue.sql -U ubuntu-it-chiedi -W )
44
45+= Configure pgfulltext =
46+
47+1) cd forum_modules/pgfulltext
48+2) psql -U ubuntu-it-chiedi ubuntu-it-chiedi -W < pg_fts_install.sql
49+3) python /src/CHANGE_THIS_PATH/www/osqa/manage.py syncdb
50+
51 = Other =
52
53 We can perform other changes, if needed, using bzr with no access on
54
55=== modified file 'forum_modules/pgfulltext/handlers.py'
56--- forum_modules/pgfulltext/handlers.py 2012-06-22 20:37:14 +0000
57+++ forum_modules/pgfulltext/handlers.py 2012-08-05 06:03:19 +0000
58@@ -16,11 +16,11 @@
59 tables = ['forum_rootnode_doc'],
60 select={
61 'ranking': """
62- rank_exact_matches(ts_rank_cd('{0.1, 0.2, 0.8, 1.0}'::float4[], "forum_rootnode_doc"."document", to_tsquery('english', %s), 32))
63+ rank_exact_matches(ts_rank_cd('{0.1, 0.2, 0.8, 1.0}'::float4[], "forum_rootnode_doc"."document", to_tsquery('italian', %s), 32))
64 """,
65 },
66 where=["""
67- "forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('english', %s) OR
68+ "forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('italian', %s) OR
69 "forum_node"."title" ILIKE %s)
70 """],
71 params=[tsquery, ilike],
72
73=== modified file 'forum_modules/pgfulltext/pg_fts_install.sql'
74--- forum_modules/pgfulltext/pg_fts_install.sql 2012-06-22 20:37:14 +0000
75+++ forum_modules/pgfulltext/pg_fts_install.sql 2012-08-05 06:03:19 +0000
76@@ -54,15 +54,15 @@
77 END IF;
78
79 SELECT
80- setweight(to_tsvector('english', coalesce(tagnames,'')), 'A') ||
81- setweight(to_tsvector('english', coalesce(title,'')), 'B') ||
82- setweight(to_tsvector('english', coalesce(body,'')), 'C') INTO doc
83+ setweight(to_tsvector('italian', coalesce(tagnames,'')), 'A') ||
84+ setweight(to_tsvector('italian', coalesce(title,'')), 'B') ||
85+ setweight(to_tsvector('italian', coalesce(body,'')), 'C') INTO doc
86 FROM forum_node WHERE id = root_id;
87
88 SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%');
89
90 IF rcount > 0 THEN
91- FOR cv in SELECT setweight(to_tsvector('english', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%') LOOP
92+ FOR cv in SELECT setweight(to_tsvector('italian', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%') LOOP
93 doc :=(doc || cv);
94 END LOOP;
95 END IF;
96
97=== modified file 'settings_local.py'
98--- settings_local.py 2012-07-15 16:14:56 +0000
99+++ settings_local.py 2012-08-05 06:03:19 +0000
100@@ -46,7 +46,7 @@
101 # This should be equal to your domain name, plus the web application context.
102 # This shouldn't be followed by a trailing slash.
103 # I.e., http://www.yoursite.com or http://www.hostedsite.com/yourhostapp
104-APP_URL = 'http://CHANGE_THIS_PATH'
105+APP_URL = 'http://chiedi.ubuntu-it.org'
106
107 #LOCALIZATIONS
108 TIME_ZONE = 'Europe/Rome'
109@@ -57,7 +57,7 @@
110 LANGUAGE_CODE = 'it'
111
112 DJANGO_VERSION = 1.3
113-OSQA_DEFAULT_SKIN = 'default'
114+OSQA_DEFAULT_SKIN = 'light'
115
116 # disable mysqlfulltxt and local authentication (registrations users)
117-DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'mysqlfulltext', 'localauth', 'oauthauth', 'facebookauth']
118+DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'mysqlfulltext', 'localauth', 'oauthauth', 'facebookauth', 'sphinxfulltext']

Subscribers

No one subscribed via source and target branches