fix media

This commit is contained in:
j 2021-11-19 15:26:58 +01:00
parent a59093d7d2
commit c425753f11
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ import ox
class Event(models.Model): class Event(models.Model):
class Meta: class Meta:
ordering = ('position', ) ordering = ('position', 'date')
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)

View file

@ -63,10 +63,10 @@ def timeline(request):
}, },
"unique_id": event.slug "unique_id": event.slug
}) })
if self.media: if event.media:
timeline['events'][-1]['media'] = { timeline['events'][-1]['media'] = {
"url": self.media, "url": event.media,
"caption": self.media_caption, "caption": event.media_caption,
} }
context['timeline_json'] = json.dumps(timeline) context['timeline_json'] = json.dumps(timeline)
return render(request, 'timeline.html', context) return render(request, 'timeline.html', context)