From 5a09e335ae3b9d1f2bc814d011bcf90a16220777 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 31 Dec 2012 09:52:28 -0600 Subject: 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 --- todolists/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'todolists/models.py') 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 -- cgit v1.2.3-24-g4f1b