diff options
-rw-r--r-- | todolists/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/todolists/models.py b/todolists/models.py index 7af7faf9..c38c564e 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 |