aboutsummaryrefslogtreecommitdiffstats
path: root/piccast
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2011-05-02 21:00:06 -0400
committerbnewbold <bnewbold@robocracy.org>2011-05-02 21:00:06 -0400
commitcb7110e3694bba239f7754f275c071341bba1088 (patch)
tree2b17c927bfb4705fb7d4b73cce75b585ca39094b /piccast
parentd50250e74fca8911b97454d19ddb782a98866a11 (diff)
downloadpiccast-cb7110e3694bba239f7754f275c071341bba1088.zip
piccast-cb7110e3694bba239f7754f275c071341bba1088.tar.gz
added 'last_updated_unixtime' for feeds
Diffstat (limited to 'piccast')
-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,