summaryrefslogtreecommitdiffstats
path: root/todolists/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-31 16:52:28 +0100
committerDan McGee <dan@archlinux.org>2012-12-31 16:52:28 +0100
commit5a09e335ae3b9d1f2bc814d011bcf90a16220777 (patch)
tree9cf7cbb88eb721c0a575c7566f8cb7e1404df2ca /todolists/models.py
parent7bb5c54d7ee3112eaa827bad5b2be10a017dbb3e (diff)
downloadarchweb-5a09e335ae3b9d1f2bc814d011bcf90a16220777.tar.gz
archweb-5a09e335ae3b9d1f2bc814d011bcf90a16220777.tar.xz
Add 'removed' field to todolist packages
This will be utilized to soft-delete items from the list if the packages are modified, rather than deleting them outright. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'todolists/models.py')
-rw-r--r--todolists/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/todolists/models.py b/todolists/models.py
index 76af0d3..e02cdd1 100644
--- a/todolists/models.py
+++ b/todolists/models.py
@@ -66,12 +66,15 @@ class TodolistPackage(models.Model):
arch = models.ForeignKey(Arch)
repo = models.ForeignKey(Repo)
created = models.DateTimeField()
- status = models.SmallIntegerField(default=0, choices=STATUS_CHOICES)
+ removed = models.DateTimeField(null=True, blank=True)
+ status = models.SmallIntegerField(default=INCOMPLETE,
+ choices=STATUS_CHOICES)
user = models.ForeignKey(User, null=True, on_delete=models.SET_NULL)
comments = models.TextField(null=True, blank=True)
class Meta:
unique_together = (('todolist','pkgname', 'arch'),)
+ get_latest_by = 'created'
def __unicode__(self):
return self.pkgname