Verified Commit 2954ceb5 authored by Gijs Hendriksen's avatar Gijs Hendriksen Committed by Sébastiaan Versteeg
Browse files

Added viewset for retrieving next two days with events

parent c21f838f
......@@ -52,6 +52,21 @@ class EventViewset(viewsets.ReadOnlyModelViewSet):
return Response(
def shortlist(self, request):
days = Event.objects.filter(, published=True
).datetimes('start', 'day')[:2]
data = list(map(lambda day: EventListSerializer(Event.objects.filter(,
), many=True, context={'request': request}).data, days))
return Response(data)
def calendarjs(self, request):
end, start = _extract_date_range(request)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment