diff options
Diffstat (limited to 'sublab_project/calendarium/views.py')
-rw-r--r-- | sublab_project/calendarium/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sublab_project/calendarium/views.py b/sublab_project/calendarium/views.py index 60f00ef..4b11c7b 100644 --- a/sublab_project/calendarium/views.py +++ b/sublab_project/calendarium/views.py @@ -1 +1,13 @@ -# Create your views here. +from django.shortcuts import render + +from models import Event + + +def list_events(request): + """Displays all events grouped by source. + """ + context = { + 'events_source_import': Event.objects.filter(source=Event.SOURCE_IMPORT), + 'events_source_admin': Event.objects.filter(source=Event.SOURCE_ADMIN), + } + return render(request, 'calendarium/list_events.html', context) |