diff libervia/pages/blog/view/page_meta.py @ 1137:dfd6545a205a

pages (blog/view, tickets): use of new "order_by" feature.
author Goffi <goffi@goffi.org>
date Sun, 06 Jan 2019 17:45:44 +0100
parents 122dd136d1ab
children e1a953512f72
line wrap: on
line diff
--- a/libervia/pages/blog/view/page_meta.py	Fri Jan 04 12:52:09 2019 +0100
+++ b/libervia/pages/blog/view/page_meta.py	Sun Jan 06 17:45:44 2019 +0100
@@ -107,7 +107,7 @@
                                       node,
                                       C.NO_LIMIT,
                                       [],
-                                      {},
+                                      {C.KEY_ORDER_BY: C.ORDER_BY_CREATION},
                                       profile)
             except Exception as e:
                 log.warning(_(u"Can't get comments at {node} (service: {service}): {msg}").format(
@@ -163,7 +163,10 @@
     if item_id:
         extra = {}
     else:
-        extra = {u'rsm_max': u'10'}
+        extra = {
+            C.KEY_ORDER_BY: C.ORDER_BY_CREATION,
+            u'rsm_max': u'10',
+        }
         if u'after' in params:
             extra[u'rsm_after'] = params[u'after']
         elif u'before' in params:
@@ -199,7 +202,10 @@
             self.pageError(request, C.HTTP_NOT_FOUND)
 
         # no items, we have requested items before last post, or blog is empty
-        extra = {u'rsm_max': u'10'}
+        extra = {
+            C.KEY_ORDER_BY: C.ORDER_BY_CREATION,
+            u'rsm_max': u'10',
+        }
         blog_data, items = yield getBlogData(self, request, service, node, None, extra, profile)
         if items:
             last_id = items[-1].id