summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-06-28 02:10:28 +0200
committerDusty Phillips <buchuki@gmail.com>2008-06-28 02:10:28 +0200
commitfdaa35a9386ccb8adab23f46d9260f8ed407bf5c (patch)
treec515ad832889f513252706e073173bc63601a81b /main
parentacc68977135b880b28f2aa83b6938eae46467195 (diff)
downloadarchweb-fdaa35a9386ccb8adab23f46d9260f8ed407bf5c.tar.gz
archweb-fdaa35a9386ccb8adab23f46d9260f8ed407bf5c.tar.xz
refactor todo packages a bit
Diffstat (limited to 'main')
-rw-r--r--main/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index cab6a9c..6688031 100644
--- a/main/models.py
+++ b/main/models.py
@@ -290,6 +290,15 @@ class Todolist(models.Model):
objects = TodolistManager()
def __str__(self):
return self.name
+
+ @property
+ def packages(self):
+ return TodolistPkg.objects.filter(list=self.id).order_by('pkg')
+
+ @property
+ def package_names(self):
+ return '\n'.join([p.pkg.pkgname for p in self.packages])
+
class Meta:
db_table = 'todolists'