group by type
This commit is contained in:
parent
5523475988
commit
4fbb4b1c55
1 changed files with 3 additions and 1 deletions
|
@ -22,6 +22,7 @@ def timeline(request):
|
||||||
context['intro'], c = Page.objects.get_or_create(slug='intro')
|
context['intro'], c = Page.objects.get_or_create(slug='intro')
|
||||||
|
|
||||||
timeline = {'events': []}
|
timeline = {'events': []}
|
||||||
|
|
||||||
for event in Event.objects.all().order_by('position'):
|
for event in Event.objects.all().order_by('position'):
|
||||||
if not event.date:
|
if not event.date:
|
||||||
continue
|
continue
|
||||||
|
@ -61,7 +62,8 @@ def timeline(request):
|
||||||
"headline": event.title,
|
"headline": event.title,
|
||||||
"text": event.body
|
"text": event.body
|
||||||
},
|
},
|
||||||
"unique_id": event.slug
|
"group": event.type,
|
||||||
|
"unique_id": event.slug,
|
||||||
})
|
})
|
||||||
if event.media:
|
if event.media:
|
||||||
timeline['events'][-1]['media'] = {
|
timeline['events'][-1]['media'] = {
|
||||||
|
|
Loading…
Reference in a new issue