From 747c053c8914589a43a5e9c68a0bcae96da397fe Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 25 Oct 2017 14:06:12 +1100 Subject: [PATCH] Default to the author's avatar when picking the image for an entry, we will support u-photo later on but we don't just yet --- entries/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/entries/models.py b/entries/models.py index 29affe3..db8064e 100644 --- a/entries/models.py +++ b/entries/models.py @@ -27,6 +27,7 @@ class Entry(ModelMeta, models.Model): _metadata = { 'description': 'content', + 'image': 'image_url', 'twitter_creator': 'twitter_creator', 'og_profile_id': 'og_profile_id', } @@ -39,6 +40,10 @@ class Entry(ModelMeta, models.Model): def og_profile_id(self): return self.author.facebook_id + @property + def image_url(self): + return self.author.avatar_url + def __str__(self): return '{kind} {id}: {content}'.format( kind=self.kind,