def events(request):
+ events = Event.objects.filter(date_end__gte=datetime.now())
+ events = events.filter(**{"published_%s" % request.LANGUAGE_CODE: True})
return render(request, 'events/event_list.html', {
- 'object_list': Event.objects.filter(date__gte=datetime.now())
+ 'object_list': events,
})
def events_past(request):
+ events = Event.objects.filter(date__lte=datetime.now()).order_by('-date')
+ events = events.filter(**{"published_%s" % request.LANGUAGE_CODE: True})
return render(request, 'events/event_list.html', {
- 'object_list': Event.objects.filter(date__lte=datetime.now()
- ).order_by('-date'),
+ 'object_list': events,
'past': True,
})