diff options
author | Dan McGee <dan@archlinux.org> | 2012-12-29 19:26:50 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-12-29 19:26:50 +0100 |
commit | 39a603bf65c4aec780e4711074e9ed27fb7c301e (patch) | |
tree | 0fe9a20dc9580c80438fbfe382bc6bfe01331880 | |
parent | abe02e3a2a6cf4fd4b0b82c2a1dd4259a9a5debe (diff) | |
download | archweb-39a603bf65c4aec780e4711074e9ed27fb7c301e.tar.gz archweb-39a603bf65c4aec780e4711074e9ed27fb7c301e.tar.xz |
Defer the 'raw' field when listing todolists
A lot like skipping fetching of the news content; we definitely don't
need this just to list the todolists on index pages.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | todolists/utils.py | 2 | ||||
-rw-r--r-- | todolists/views.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/todolists/utils.py b/todolists/utils.py index d084c64..0daca3b 100644 --- a/todolists/utils.py +++ b/todolists/utils.py @@ -19,7 +19,7 @@ SELECT todolist_id, count(*), sum(CASE WHEN status = %s THEN 1 ELSE 0 END) def get_annotated_todolists(incomplete_only=False): - lists = Todolist.objects.all().select_related( + lists = Todolist.objects.all().defer('raw').select_related( 'creator').order_by('-created') lookup = todo_counts() diff --git a/todolists/views.py b/todolists/views.py index 413d867..788d74f 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -206,7 +206,7 @@ def send_todolist_emails(todo_list, new_packages): def public_list(request): - todo_lists = Todolist.objects.incomplete() + todo_lists = Todolist.objects.incomplete().defer('raw') # total hackjob, but it makes this a lot less query-intensive. all_pkgs = [tp for tl in todo_lists for tp in tl.packages()] attach_maintainers(all_pkgs) |