summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-31 10:17:22 -0600
committerDan McGee <dan@archlinux.org>2012-12-31 10:17:22 -0600
commit04f23a040a839f4989fdc83afe0f5ad4f72224be (patch)
tree4118ce2a278f895bfb54d9f35ba2a3897d4cd3a6 /main/models.py
parent5a09e335ae3b9d1f2bc814d011bcf90a16220777 (diff)
Add 'created' field to packages model
This will be used to eventually implement the UI side of FS#13441, but to do that, we first need the data. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 7ec04ad7..39bc555e 100644
--- a/main/models.py
+++ b/main/models.py
@@ -103,6 +103,7 @@ class Package(models.Model):
build_date = models.DateTimeField(null=True)
last_update = models.DateTimeField(db_index=True)
files_last_update = models.DateTimeField(null=True, blank=True)
+ created = models.DateTimeField()
packager_str = models.CharField(max_length=255)
packager = models.ForeignKey(User, null=True, blank=True,
on_delete=models.SET_NULL)
@@ -424,6 +425,8 @@ from django.db.models.signals import pre_save, post_save
post_save.connect(refresh_latest, sender=Package,
dispatch_uid="main.models")
+# note: reporead sets the 'created' field on Package objects, so no signal
+# listener is set up here to do so
pre_save.connect(set_created_field, sender=Donor,
dispatch_uid="main.models")