]> git.0d.be Git - django-panik-combo.git/commitdiff
order newsitems
authorFrédéric Péters <fpeters@0d.be>
Sun, 31 May 2015 11:52:11 +0000 (13:52 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 31 May 2015 11:52:11 +0000 (13:52 +0200)
panikombo/models.py

index 57848f57127874b103d57cec11916b4f256a37cc..617212a6546e0e75bc443d10bf1300c6fae7eb62 100644 (file)
@@ -140,6 +140,7 @@ class NewsItemAutoSelectionCell(CellBase):
             newsitems_queryset = newsitems_queryset.filter(event_date__gte=date.today())
         if self.category:
             newsitems_queryset = newsitems_queryset.filter(category=self.category)
             newsitems_queryset = newsitems_queryset.filter(event_date__gte=date.today())
         if self.category:
             newsitems_queryset = newsitems_queryset.filter(category=self.category)
+        newsitems_queryset = newsitems_queryset.order_by('-event_date', '-creation_timestamp')
         return newsitems_queryset
 
     def render(self, context):
         return newsitems_queryset
 
     def render(self, context):