]> git.openstreetmap.org Git - osqa.git/commitdiff
Allow modules to set custom sorts on rss feeds.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 26 May 2011 14:49:47 +0000 (14:49 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 26 May 2011 14:49:47 +0000 (14:49 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1049 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/readers.py

index 9efdf07902449e7abf80e51fa650c252e0e5479e..6ee2c24942372674490bcd18a86356633145e914 100644 (file)
@@ -159,7 +159,8 @@ def question_list(request, initial,
                   page_title=_("All Questions"),
                   allowIgnoreTags=True,
                   feed_url=None,
-                  paginator_context=None):
+                  paginator_context=None,
+                  feed_sort='-added_at'):
 
     questions = initial.filter_state(deleted=False)
 
@@ -170,7 +171,7 @@ def question_list(request, initial,
         page_title = _("Questions")
 
     if request.GET.get('type', None) == 'rss':
-        questions = questions.order_by('-added_at')
+        questions = questions.order_by(feed_sort)
         return RssQuestionFeed(request, questions, page_title, list_description)(request)
 
     keywords =  ""