]> git.openstreetmap.org Git - osqa.git/blob - forum_modules/pgfulltext/handlers.py
Make the admin title link point to the admin base, and added a link to et back to...
[osqa.git] / forum_modules / pgfulltext / handlers.py
1 from forum.models import Question
2 from forum.modules.decorators import decorate
3 from forum.views.readers import do_question_search
4
5 @decorate(do_question_search, needs_origin=False)
6 def question_search(keywords):
7     return Question.objects.all().extra(
8                     select={
9                         'ranking': 'node_ranking("forum_node"."id", %s)',
10                     },
11                     where=['node_ranking("forum_node"."id", %s) > 0'],
12                     params=[keywords],
13                     select_params=[keywords],
14                     order_by=['-ranking']
15                 )