mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Widget: remove limit of 50 events in list-view by adding a load-more-button (#2144)
This commit is contained in:
committed by
GitHub
parent
965aac6ad5
commit
bdd9751f0e
@@ -1004,6 +1004,11 @@ class Event(EventMixin, LoggedModel):
|
||||
| Q(date_to__gte=now() - timedelta(hours=24))
|
||||
)
|
||||
) # order_by doesn't make sense with I18nField
|
||||
if ordering in ("date_ascending", "date_descending"):
|
||||
# if primary order is by date, then order in database
|
||||
# this allows to limit/slice results
|
||||
return subevs.order_by(*orderfields)
|
||||
|
||||
for f in reversed(orderfields):
|
||||
if f.startswith('-'):
|
||||
subevs = sorted(subevs, key=attrgetter(f[1:]), reverse=True)
|
||||
|
||||
Reference in New Issue
Block a user