Mercurial > public > sg101
comparison gpp/weblinks/views.py @ 191:046e6ef0ff45
Added select_related() to weblinks.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 01 Apr 2010 02:01:33 +0000 |
parents | 952e05cb3d80 |
children | b4305e18d3af |
comparison
equal
deleted
inserted
replaced
190:0e4961833cdf | 191:046e6ef0ff45 |
---|---|
191 else: | 191 else: |
192 return HttpResponseRedirect(reverse('weblinks.views.link_index')) | 192 return HttpResponseRedirect(reverse('weblinks.views.link_index')) |
193 | 193 |
194 links = Link.public_objects.filter( | 194 links = Link.public_objects.filter( |
195 Q(title__icontains = query_text) | | 195 Q(title__icontains = query_text) | |
196 Q(description__icontains = query_text)).order_by('title') | 196 Q(description__icontains = query_text)).order_by('title').select_related() |
197 paginator = create_paginator(links) | 197 paginator = create_paginator(links) |
198 try: | 198 try: |
199 the_page = paginator.page(int(page)) | 199 the_page = paginator.page(int(page)) |
200 except EmptyPage: | 200 except EmptyPage: |
201 links = Link.public_objects.none() | 201 links = Link.public_objects.none() |