Negligible code cleanup for the sake of clarity.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2969 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2006-05-23 19:34:43 +00:00
parent 9a4c39bb82
commit 23269289be
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,6 @@ def object_list(request, queryset, paginate_by=None, allow_empty=False,
number of objects, total number of objects, total
""" """
queryset = queryset._clone() queryset = queryset._clone()
model = queryset.model
if paginate_by: if paginate_by:
paginator = ObjectPaginator(queryset, paginate_by) paginator = ObjectPaginator(queryset, paginate_by)
page = request.GET.get('page', 1) page = request.GET.get('page', 1)
@ -71,6 +70,7 @@ def object_list(request, queryset, paginate_by=None, allow_empty=False,
else: else:
c[key] = value c[key] = value
if not template_name: if not template_name:
model = queryset.model
template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower()) template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower())
t = template_loader.get_template(template_name) t = template_loader.get_template(template_name)
return HttpResponse(t.render(c)) return HttpResponse(t.render(c))