aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--piccast/feeds/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/piccast/feeds/models.py b/piccast/feeds/models.py
index 2b04b7a..cbc12e4 100644
--- a/piccast/feeds/models.py
+++ b/piccast/feeds/models.py
@@ -83,6 +83,9 @@ class PicFeed(models.Model):
(self.image.serializable_short() if self.image else None),
'category':
(self.category.name if self.category else None),
+ 'last_updated_unixtime':
+ (int(self.picset_set.latest().created.strftime("%s"))
+ if (self.picset_set.count() > 0) else None),
}
class PicSet(models.Model):
@@ -101,6 +104,9 @@ class PicSet(models.Model):
def __unicode__(self):
return self.title
+
+ class Meta:
+ get_latest_by = "created"
def serializable(self):
return {'id': self.id,