public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/
@ 2012-06-29 17:29 99% Slava Bacherikov
  0 siblings, 0 replies; 1+ results
From: Slava Bacherikov @ 2012-06-29 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     1534ff4c1ae792366ecdf5a426c55e32130a7722
Author:     Slava Bacherikov <slava <AT> bacher09 <DOT> org>
AuthorDate: Fri Jun 29 00:28:28 2012 +0000
Commit:     Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua>
CommitDate: Fri Jun 29 00:28:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=1534ff4c

Litle optimize queries

---
 gpackages/apps/packages/views.py |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/gpackages/apps/packages/views.py b/gpackages/apps/packages/views.py
index 98672d4..3b4cd23 100644
--- a/gpackages/apps/packages/views.py
+++ b/gpackages/apps/packages/views.py
@@ -56,15 +56,8 @@ class PackagesListsView(ContextListView):
     context_object_name = 'packages'
     queryset = PackageModel.objects.all(). \
         select_related('virtual_package',
-                       'virtual_package__category',
-                       'repository'). \
-        defer('repository__description',
-              'repository__owner_name',
-              'repository__owner_email',
-              'repository__homepage',
-              'repository__official',
-              'repository__quality',
-              'changelog'). \
+                       'virtual_package__category'). \
+        prefetch_related('repository'). \
         prefetch_keywords(arches)
 
 class PackageDetailView(ContextView, DetailView):
@@ -74,15 +67,8 @@ class PackageDetailView(ContextView, DetailView):
     context_object_name = 'package'
     queryset = PackageModel.objects.all(). \
         select_related('virtual_package',
-                       'virtual_package__category',
-                       'repository'). \
-        defer('repository__description',
-              'repository__owner_name',
-              'repository__owner_email',
-              'repository__homepage',
-              'repository__official',
-              'repository__quality',
-              'changelog'). \
+                       'virtual_package__category'). \
+        prefetch_related('repository'). \
         prefetch_keywords(arches)
 
     def get_object(self, queryset = None):



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-06-29 17:29 99% [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/ Slava Bacherikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox