summaryrefslogtreecommitdiff
path: root/todolists/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'todolists/models.py')
-rw-r--r--todolists/models.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/todolists/models.py b/todolists/models.py
index 156b041d..040f8a29 100644
--- a/todolists/models.py
+++ b/todolists/models.py
@@ -10,8 +10,9 @@ from main.utils import set_created_field
class TodolistManager(models.Manager):
def incomplete(self):
- not_done = (Q(todolistpackage__status=TodolistPackage.INCOMPLETE) |
- Q(todolistpackage__status=TodolistPackage.IN_PROGRESS))
+ not_done = ((Q(todolistpackage__status=TodolistPackage.INCOMPLETE) |
+ Q(todolistpackage__status=TodolistPackage.IN_PROGRESS)) &
+ Q(todolistpackage__removed__isnull=True))
return self.order_by().filter(not_done).distinct()
@@ -44,7 +45,8 @@ class Todolist(models.Model):
def packages(self):
if not hasattr(self, '_packages'):
- self._packages = self.todolistpackage_set.select_related(
+ self._packages = self.todolistpackage_set.filter(
+ removed__isnull=True).select_related(
'pkg', 'repo', 'arch').order_by('pkgname', 'arch')
return self._packages