api: rely on model default ordering when presenting list of events

This commit is contained in:
Frédéric Péters 2016-09-13 19:12:28 +02:00
parent aac59de1c5
commit afedcf933f
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class Datetimes(GenericAPIView):
if agenda.maximal_booking_delay:
kwargs['start_datetime__lt'] = (now() + datetime.timedelta(days=agenda.maximal_booking_delay)).date()
entries = Event.objects.filter(agenda=pk).filter(**kwargs).order_by('start_datetime')
entries = Event.objects.filter(agenda=pk).filter(**kwargs)
response = {'data': [{'id': x.id, 'text': unicode(x)} for x in entries]}
return Response(response)