group by type

This commit is contained in:
j 2022-03-18 18:36:06 +00:00
parent 5523475988
commit 4fbb4b1c55

View file

@ -22,6 +22,7 @@ def timeline(request):
context['intro'], c = Page.objects.get_or_create(slug='intro')
timeline = {'events': []}
for event in Event.objects.all().order_by('position'):
if not event.date:
continue
@ -61,7 +62,8 @@ def timeline(request):
"headline": event.title,
"text": event.body
},
"unique_id": event.slug
"group": event.type,
"unique_id": event.slug,
})
if event.media:
timeline['events'][-1]['media'] = {