summaryrefslogtreecommitdiffstats
path: root/todolists
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-28 06:32:05 +0100
committerDan McGee <dan@archlinux.org>2012-12-28 16:19:19 +0100
commitf07a5862c9ed40646677344eaf920dbd05a1a137 (patch)
treeb5e0162b0cfe543fb0c848aade770e95a051554f /todolists
parentf167d6e6e8ba2ca5e29f6a1a82b0e273ffec13ab (diff)
downloadarchweb-f07a5862c9ed40646677344eaf920dbd05a1a137.tar.gz
archweb-f07a5862c9ed40646677344eaf920dbd05a1a137.tar.xz
Add packages method to new Todolist model
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'todolists')
-rw-r--r--todolists/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/todolists/models.py b/todolists/models.py
index 7af7faf..c38c564 100644
--- a/todolists/models.py
+++ b/todolists/models.py
@@ -41,6 +41,12 @@ class Todolist(models.Model):
domain = Site.objects.get_current().domain
return '%s://%s%s' % (proto, domain, self.get_absolute_url())
+ def packages(self):
+ if not hasattr(self, '_packages'):
+ self._packages = self.todolistpackage_set.select_related(
+ 'pkg', 'repo', 'arch').order_by('pkgname', 'arch')
+ return self._packages
+
class TodolistPackage(models.Model):
INCOMPLETE = 0