1 from datetime import datetime
2 from django.shortcuts import render
3 from events.models import Event
7 events = Event.objects.filter(date_end__gte=datetime.now())
8 events = events.filter(**{"published_%s" % request.LANGUAGE_CODE: True})
9 return render(request, 'events/event_list.html', {
10 'object_list': events,
14 def events_past(request):
15 events = Event.objects.filter(date__lte=datetime.now()).order_by('-date')
16 events = events.filter(**{"published_%s" % request.LANGUAGE_CODE: True})
17 return render(request, 'events/event_list.html', {
18 'object_list': events,