promobox corner fix
[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     return render(request, 'events/event_list.html', {
8         'object_list': Event.objects.filter(date__gte=datetime.now())
9     })
10
11
12 def events_past(request):
13     return render(request, 'events/event_list.html', {
14         'object_list': Event.objects.filter(date__lte=datetime.now()
15             ).order_by('-date'),
16         'past': True,
17     })