# HG changeset patch # User Brian Neal # Date 1270087293 0 # Node ID 046e6ef0ff4542a0aff5145652a546d28a438ab6 # Parent 0e4961833cdf73156d3d232dad72dc1c42bc25f8 Added select_related() to weblinks. diff -r 0e4961833cdf -r 046e6ef0ff45 gpp/weblinks/models.py --- a/gpp/weblinks/models.py Thu Apr 01 01:57:01 2010 +0000 +++ b/gpp/weblinks/models.py Thu Apr 01 02:01:33 2010 +0000 @@ -25,7 +25,8 @@ class PublicLinkManager(models.Manager): """The manager for all public links.""" def get_query_set(self): - return super(PublicLinkManager, self).get_query_set().filter(is_public=True) + return super(PublicLinkManager, self).get_query_set().filter( + is_public=True).select_related() class Link(models.Model): diff -r 0e4961833cdf -r 046e6ef0ff45 gpp/weblinks/views.py --- a/gpp/weblinks/views.py Thu Apr 01 01:57:01 2010 +0000 +++ b/gpp/weblinks/views.py Thu Apr 01 02:01:33 2010 +0000 @@ -193,7 +193,7 @@ links = Link.public_objects.filter( Q(title__icontains = query_text) | - Q(description__icontains = query_text)).order_by('title') + Q(description__icontains = query_text)).order_by('title').select_related() paginator = create_paginator(links) try: the_page = paginator.page(int(page))