Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #9083 -- Improved get_admin_log template tag so that it doesn't…

… run a separate SQL query for every record in the 'history' sidebar on the admin homepage. Thanks for the patch, santip

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit af23d8d3b38270f58404c002942bcc200f1855bf 1 parent 1fcf330
Adrian Holovaty adrianholovaty authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/admin/templatetags/log.py
4 django/contrib/admin/templatetags/log.py
View
@@ -12,11 +12,11 @@ def __repr__(self):
def render(self, context):
if self.user is None:
- context[self.varname] = LogEntry.objects.all().select_related()[:self.limit]
+ context[self.varname] = LogEntry.objects.all().select_related('content_type', 'user')[:self.limit]
else:
if not self.user.isdigit():
self.user = context[self.user].id
- context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related()[:self.limit]
+ context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related('content_type', 'user')[:self.limit]
return ''
class DoGetAdminLog:
Please sign in to comment.
Something went wrong with that request. Please try again.