From 0e58a2e49f59fe41a27afa7bf8f9b3c77405c6d1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 4 Oct 2010 16:35:31 -0500 Subject: Todo list minor fixes and comments for later When we show the edit todo list page, use a sorted list retrieved straight from the database instead of a unordered set() we create at the application level. Also add some comments for potential later improvements on transaction boundaries and async emailing. Signed-off-by: Dan McGee --- main/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/models.py b/main/models.py index c3cb5cf..79d99e8 100644 --- a/main/models.py +++ b/main/models.py @@ -307,7 +307,8 @@ class Todolist(models.Model): @property def package_names(self): - return '\n'.join(set([p.pkg.pkgname for p in self.packages])) + # depends on packages property returning a queryset + return self.packages.values_list('pkg__pkgname', flat=True).distinct() class Meta: db_table = 'todolists' -- cgit v1.2.3-24-g4f1b