Permalink
Browse files

added dateUdated and status fields to Snapshot

  • Loading branch information...
1 parent 744d4f0 commit 20ef2da67765e27f4e78df6b4c95ef8fe84f380f @ekpneo ekpneo committed Aug 10, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 geocamLens/models.py
View
@@ -105,14 +105,20 @@ class Snapshot(models.Model):
ymax = models.FloatField()
title = models.CharField(max_length=64)
comment = models.TextField()
+ status = models.CharField(max_length=1, choices=STATUS_CHOICES, default=STATUS_ACTIVE)
dateCreated = models.DateTimeField(null=True, blank=True)
+ dateUpdated = models.DateTimeField(null=True, blank=True)
# img is a virtual field, not actually present in the db. it
# specifies which image this snapshot is associated with based on
# imgType (which db table to look in) and imgId (which row in the
# table).
img = generic.GenericForeignKey('imgType', 'imgId')
+ def save(self, **kwargs):
+ self.dateUpdated = datetime.datetime.utcnow()
+ super(Snapshot, self).save(**kwargs)
+
def __unicode__(self):
return self.title

0 comments on commit 20ef2da

Please sign in to comment.