registration form with survey
[prawokultury.git] / events / views.py
1 from datetime import datetime
2 from django.shortcuts import render
3 from events.models import Event
4
5
6 def events(request):
7     events = Event.objects.filter(date__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,
11     })
12
13
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,
19         'past': True,
20     })