summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-10-04 16:35:31 -0500
committerDan McGee <dan@archlinux.org>2010-10-04 16:35:31 -0500
commit0e58a2e49f59fe41a27afa7bf8f9b3c77405c6d1 (patch)
tree9943d4c2984b2e18586cb8fd530bbe733ec81b72 /main/models.py
parent5e509529f00bd50ddfc6638d92c601209664d5d8 (diff)
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 <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/models.py b/main/models.py
index c3cb5cf0..79d99e8c 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'