Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added dateUdated and status fields to Snapshot

  • Loading branch information...
commit 20ef2da67765e27f4e78df6b4c95ef8fe84f380f 1 parent 744d4f0
@ekpneo ekpneo authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 geocamLens/models.py
View
6 geocamLens/models.py
@@ -105,7 +105,9 @@ 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
@@ -113,6 +115,10 @@ class Snapshot(models.Model):
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.