Compare commits

...
2 changed files with 3 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -1950,7 +1950,7 @@ class EventFilterForm(FilterForm):
orders = {
'slug': 'slug',
'organizer': 'organizer__name',
'date_from': 'order_from',
'date_from': 'order_from_min',
'date_to': 'order_to',
'live': 'live',
}
+2 -1
View File
@@ -87,7 +87,8 @@ class EventList(PaginationMixin, ListView):
max_to=Max('subevents__date_to'),
max_fromto=Greatest(Max('subevents__date_to'), Max('subevents__date_from'))
).annotate(
order_from=Coalesce('max_from', 'date_from'),
order_from=Coalesce('max_from', 'date_from'), # default ordering
order_from_min=Coalesce('min_from', 'date_from'), # used when manually ordered by date_from
order_to=Coalesce('max_fromto', 'max_to', 'max_from', 'date_to', 'date_from'),
).order_by("-order_from")