Commit 5224659c authored by Giuseppe Terrasi's avatar Giuseppe Terrasi

parents 8f7a0529 5caf59b0
...@@ -18,7 +18,7 @@ Aggiunta cartella "it", la nostra localizzazione, prima non presente. ...@@ -18,7 +18,7 @@ Aggiunta cartella "it", la nostra localizzazione, prima non presente.
= settings_local.py = = settings_local.py =
Disabilitati i seguenti moduli, di default abilitati: mysqlfulltext, localauth, oauthauth, facebookauth Disabilitati i seguenti moduli, di default abilitati: mysqlfulltext, localauth, oauthauth, facebookauth, sphinxfulltext
= forum/skins/light/media/js/wmd/wmd.js = = forum/skins/light/media/js/wmd/wmd.js =
...@@ -58,4 +58,6 @@ FIXME: proporre cambiamento upstream come da lp:~giuseppeterrasi/ubuntu-it-ask/l ...@@ -58,4 +58,6 @@ FIXME: proporre cambiamento upstream come da lp:~giuseppeterrasi/ubuntu-it-ask/l
= forum/templatetags/extra_tags.py = = forum/templatetags/extra_tags.py =
FIXME: proporre cambiamento upstream come da lp:~giuseppeterrasi/ubuntu-it-ask/l18ned FIXME: proporre cambiamento upstream come da lp:~giuseppeterrasi/ubuntu-it-ask/l18ned
= forum_modules/pgfulltext =
sostituito "english" con "italian"
...@@ -27,13 +27,14 @@ postgres-9.1 is ok. We need: ...@@ -27,13 +27,14 @@ postgres-9.1 is ok. We need:
c) timezone in Europe/Rome c) timezone in Europe/Rome
d) languages in IT d) languages in IT
e) DJANGO_VERSION = 1.3 e) DJANGO_VERSION = 1.3
f) DISABLED_MODULES add 'mysqlfulltxt', 'localauth' f) DISABLED_MODULES add 'mysqlfulltxt', 'localauth' 'sphinxfullsearch'
g) CACHE_BACKEND = 'memcached://<server-address>:<port>/ with the correct path. g) CACHE_BACKEND = 'memcached://<server-address>:<port>/ with the correct path.
5) python manage.py syncdb --all (no create super user) 5) python manage.py syncdb --all (no create super user)
6) python manage.py migrate forum --fake 6) python manage.py migrate forum --fake
7) cp -R locale l it 7) cp -R locale l it
8) python manage.py makemessages -l it 8) python manage.py makemessages -l it
** 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 ** 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
...@@ -52,6 +53,12 @@ Put 00-forum_keyvalue.sql into osqa database: ...@@ -52,6 +53,12 @@ Put 00-forum_keyvalue.sql into osqa database:
(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 ) (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 )
= Configure pgfulltext =
1) cd forum_modules/pgfulltext
2) psql -U ubuntu-it-chiedi ubuntu-it-chiedi -W < pg_fts_install.sql
3) python /src/CHANGE_THIS_PATH/www/osqa/manage.py syncdb
= Other = = Other =
We can perform other changes, if needed, using bzr with no access on We can perform other changes, if needed, using bzr with no access on
......
...@@ -16,11 +16,11 @@ def question_search(self, keywords): ...@@ -16,11 +16,11 @@ def question_search(self, keywords):
tables = ['forum_rootnode_doc'], tables = ['forum_rootnode_doc'],
select={ select={
'ranking': """ 'ranking': """
rank_exact_matches(ts_rank_cd('{0.1, 0.2, 0.8, 1.0}'::float4[], "forum_rootnode_doc"."document", to_tsquery('english', %s), 32)) rank_exact_matches(ts_rank_cd('{0.1, 0.2, 0.8, 1.0}'::float4[], "forum_rootnode_doc"."document", to_tsquery('italian', %s), 32))
""", """,
}, },
where=[""" where=["""
"forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('english', %s) OR "forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('italian', %s) OR
"forum_node"."title" ILIKE %s) "forum_node"."title" ILIKE %s)
"""], """],
params=[tsquery, ilike], params=[tsquery, ilike],
......
...@@ -54,15 +54,15 @@ begin ...@@ -54,15 +54,15 @@ begin
END IF; END IF;
SELECT SELECT
setweight(to_tsvector('english', coalesce(tagnames,'')), 'A') || setweight(to_tsvector('italian', coalesce(tagnames,'')), 'A') ||
setweight(to_tsvector('english', coalesce(title,'')), 'B') || setweight(to_tsvector('italian', coalesce(title,'')), 'B') ||
setweight(to_tsvector('english', coalesce(body,'')), 'C') INTO doc setweight(to_tsvector('italian', coalesce(body,'')), 'C') INTO doc
FROM forum_node WHERE id = root_id; FROM forum_node WHERE id = root_id;
SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%'); SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%');
IF rcount > 0 THEN IF rcount > 0 THEN
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 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
doc :=(doc || cv); doc :=(doc || cv);
END LOOP; END LOOP;
END IF; END IF;
......
...@@ -46,7 +46,7 @@ SESSION_ENGINE = 'django.contrib.sessions.backends.db' ...@@ -46,7 +46,7 @@ SESSION_ENGINE = 'django.contrib.sessions.backends.db'
# This should be equal to your domain name, plus the web application context. # This should be equal to your domain name, plus the web application context.
# This shouldn't be followed by a trailing slash. # This shouldn't be followed by a trailing slash.
# I.e., http://www.yoursite.com or http://www.hostedsite.com/yourhostapp # I.e., http://www.yoursite.com or http://www.hostedsite.com/yourhostapp
APP_URL = 'http://CHANGE_THIS_PATH' APP_URL = 'http://chiedi.ubuntu-it.org'
#LOCALIZATIONS #LOCALIZATIONS
TIME_ZONE = 'Europe/Rome' TIME_ZONE = 'Europe/Rome'
...@@ -57,7 +57,7 @@ USE_I18N = True ...@@ -57,7 +57,7 @@ USE_I18N = True
LANGUAGE_CODE = 'it' LANGUAGE_CODE = 'it'
DJANGO_VERSION = 1.3 DJANGO_VERSION = 1.3
OSQA_DEFAULT_SKIN = 'default' OSQA_DEFAULT_SKIN = 'light'
# disable mysqlfulltxt and local authentication (registrations users) # disable mysqlfulltxt and local authentication (registrations users)
DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'mysqlfulltext', 'localauth', 'oauthauth', 'facebookauth'] DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'mysqlfulltext', 'localauth', 'oauthauth', 'facebookauth', 'sphinxfulltext']
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment