From 4fbb4b1c554ed1e11eef644a291e7af559da702c Mon Sep 17 00:00:00 2001 From: j Date: Fri, 18 Mar 2022 18:36:06 +0000 Subject: [PATCH] group by type --- app/event/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/event/views.py b/app/event/views.py index b79b811..ada9527 100644 --- a/app/event/views.py +++ b/app/event/views.py @@ -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'] = {