summaryrefslogtreecommitdiff
path: root/packages/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-02 18:27:46 -0600
committerDan McGee <dan@archlinux.org>2012-02-07 00:47:14 -0600
commit087aca5cceb2dc8ac4625eb61f95b57b704bd30f (patch)
tree93b3ba92add63be454d6dd73dbffb7337c4b66af /packages/models.py
parentf0a858aab6691438eeec9094c2d46d95b5ddb306 (diff)
FlagRequest model behavior tweaks
* Add a default field to be used for latest() calls. * Remove signal-based set of created date; instead, set it explicitly so all of our packages and flag request have the exact same date and time attached. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/models.py')
-rw-r--r--packages/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/models.py b/packages/models.py
index f63d6db0..820e61ba 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -184,6 +184,9 @@ class FlagRequest(models.Model):
is_legitimate = models.BooleanField(default=True,
help_text="Is this actually an out-of-date flag request?")
+ class Meta:
+ get_latest_by = 'created'
+
def who(self):
if self.user:
return self.user.get_full_name()
@@ -258,7 +261,7 @@ class Replacement(models.Model):
# hook up some signals
-for sender in (PackageRelation, SignoffSpecification, Signoff, FlagRequest):
+for sender in (PackageRelation, SignoffSpecification, Signoff):
pre_save.connect(set_created_field, sender=sender,
dispatch_uid="packages.models")