diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-11-24 17:37:35 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-11-24 17:37:35 -0300 |
commit | 350d8b9aa7849a86fcbd97667703df834184d511 (patch) | |
tree | 567bc8c5888eaec14c04804c46106eec1adce282 | |
parent | b9069269d15a65ebd1598f5432aac9ef513e654f (diff) | |
parent | 9b576c4da5ebe34e5a219ec67452fde94a6357c0 (diff) | |
download | askbot-350d8b9aa7849a86fcbd97667703df834184d511.tar.gz askbot-350d8b9aa7849a86fcbd97667703df834184d511.tar.bz2 askbot-350d8b9aa7849a86fcbd97667703df834184d511.zip |
resolved edit conflict in the changelog
-rw-r--r-- | askbot/context.py | 2 | ||||
-rw-r--r-- | askbot/doc/source/changelog.rst | 3 | ||||
-rw-r--r-- | askbot/doc/source/contributors.rst | 2 | ||||
-rw-r--r-- | askbot/feed.py | 2 | ||||
-rw-r--r-- | askbot/models/question.py | 4 | ||||
-rw-r--r-- | askbot/skins/loaders.py | 4 |
6 files changed, 10 insertions, 7 deletions
diff --git a/askbot/context.py b/askbot/context.py index f740d293..f3665240 100644 --- a/askbot/context.py +++ b/askbot/context.py @@ -13,7 +13,7 @@ from askbot.utils import url_utils def application_settings(request): """The context processor function""" my_settings = askbot_settings.as_dict() - my_settings['LANGUAGE_CODE'] = settings.LANGUAGE_CODE + my_settings['LANGUAGE_CODE'] = getattr(request, 'LANGUAGE_CODE', settings.LANGUAGE_CODE) my_settings['ASKBOT_URL'] = settings.ASKBOT_URL my_settings['ASKBOT_CSS_DEVEL'] = getattr(settings, 'ASKBOT_CSS_DEVEL', False) my_settings['DEBUG'] = settings.DEBUG diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index 73736885..642924fd 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -16,7 +16,8 @@ Development version (not yet published) * Added ASKBOT_TRANSLATE_URL setting for url localization(Alexander Werner) * Changed javascript translation model, moved from jqueryi18n to django(Rosandra Cuello Suñol) * Private forum mode (Vlad Bokov) - +* Improved text search query in Postgresql (Alexander Werner) +* Take LANGUAGE_CODE from request (Alexander Werner) 0.7.26 (Current Version) ------------------------ diff --git a/askbot/doc/source/contributors.rst b/askbot/doc/source/contributors.rst index 3d1303c1..aca7eb48 100644 --- a/askbot/doc/source/contributors.rst +++ b/askbot/doc/source/contributors.rst @@ -30,7 +30,7 @@ Programming and documentation * `Tomasz Zielinski <http://pyconsultant.eu/>`_ * `Tomasz Szynalski <http://antimoon.com>`_ * `Raghu Udiyar <http://raags.tumblr.com/>`_ -* Alexander Werner +* `Alexander Werner <https://twitter.com/#!/bundeswerner>`_ * Rosandra Cuello Suñol Translations diff --git a/askbot/feed.py b/askbot/feed.py index 20932f1a..7f41fd4f 100644 --- a/askbot/feed.py +++ b/askbot/feed.py @@ -155,7 +155,7 @@ class RssLastestQuestionsFeed(Feed): for tag in tags: qs = qs.filter(tags__name = tag) - return qs.order_by('-last_activity_at') + return qs.order_by('-last_activity_at')[:30] diff --git a/askbot/models/question.py b/askbot/models/question.py index 7f38bd5c..c2d4be11 100644 --- a/askbot/models/question.py +++ b/askbot/models/question.py @@ -139,12 +139,12 @@ class QuestionQuerySet(models.query.QuerySet): | models.Q(answers__text__search = search_query) ) elif 'postgresql_psycopg2' in askbot.get_database_engine_name(): - rank_clause = "ts_rank(question.text_search_vector, to_tsquery(%s))"; + rank_clause = "ts_rank(question.text_search_vector, plainto_tsquery(%s))"; search_query = '&'.join(search_query.split()) extra_params = (search_query,) extra_kwargs = { 'select': {'relevance': rank_clause}, - 'where': ['text_search_vector @@ to_tsquery(%s)'], + 'where': ['text_search_vector @@ plainto_tsquery(%s)'], 'params': extra_params, 'select_params': extra_params, } diff --git a/askbot/skins/loaders.py b/askbot/skins/loaders.py index 64d14072..24559512 100644 --- a/askbot/skins/loaders.py +++ b/askbot/skins/loaders.py @@ -108,9 +108,11 @@ def get_template(template, request = None): request variable will be used in the future to set template according to the user preference or admins preference - at this point request variable is not used though + request variable is used to localize the skin if possible """ skin = get_skin(request) + if hasattr(request,'LANGUAGE_CODE'): + skin.set_language(request.LANGUAGE_CODE) return skin.get_template(template) def render_into_skin(template, data, request, mimetype = 'text/html'): |