changeset 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 ab78374e1117
children ef565839dada
files libervia/pages/blog/view/page_meta.py libervia/pages/tickets/page_meta.py
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
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
--- a/libervia/pages/tickets/page_meta.py	Fri Jan 04 12:52:09 2019 +0100
+++ b/libervia/pages/tickets/page_meta.py	Sun Jan 06 17:45:44 2019 +0100
@@ -44,7 +44,10 @@
         C.NO_LIMIT,
         [],
         "",
-        {"labels_as_list": C.BOOL_TRUE},
+        {
+            "labels_as_list": C.BOOL_TRUE,
+            C.KEY_ORDER_BY: C.ORDER_BY_CREATION,
+        },
         profile,
     )
     template_data[u"tickets"] = [template_xmlui.create(self.host, x) for x in tickets[0]]