fnp
/
prawokultury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow editing date
[prawokultury.git]
/
events
/
views.py
diff --git
a/events/views.py
b/events/views.py
index
c3c6197
..
b2dccc7
100644
(file)
--- a/
events/views.py
+++ b/
events/views.py
@@
-4,14
+4,17
@@
from events.models import Event
def events(request):
def events(request):
+ events = Event.objects.filter(date__gte=datetime.now())
+ events = events.filter(**{"published_%s" % request.LANGUAGE_CODE: True})
return render(request, 'events/event_list.html', {
return render(request, 'events/event_list.html', {
- 'object_list':
Event.objects.filter(date__gte=datetime.now())
+ 'object_list':
events,
})
def events_past(request):
})
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', {
return render(request, 'events/event_list.html', {
- 'object_list': Event.objects.filter(date__lte=datetime.now()
- ).order_by('-date'),
+ 'object_list': events,
'past': True,
})
'past': True,
})