diff options
author | Dan McGee <dan@archlinux.org> | 2012-12-31 09:52:28 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-12-31 09:52:28 -0600 |
commit | 5a09e335ae3b9d1f2bc814d011bcf90a16220777 (patch) | |
tree | 9cf7cbb88eb721c0a575c7566f8cb7e1404df2ca /todolists/models.py | |
parent | 7bb5c54d7ee3112eaa827bad5b2be10a017dbb3e (diff) |
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.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/todolists/models.py b/todolists/models.py index 76af0d35..e02cdd1a 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 |