Tiny code compression in django.views.admin.main

git-svn-id: http://code.djangoproject.com/svn/django/trunk@290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-22 04:40:37 +00:00
parent a1f479e080
commit 2d3def9fa2
1 changed files with 1 additions and 2 deletions

View File

@ -102,9 +102,8 @@ def change_list(request, app_label, module_name):
order_field, order_type = lookup_opts.pk.name, 'DESC'
if params.has_key(ORDER_VAR):
try:
order_key = int(params[ORDER_VAR])
try:
f = lookup_opts.get_field(lookup_opts.admin.list_display[order_key])
f = lookup_opts.get_field(lookup_opts.admin.list_display[int(params[ORDER_VAR])])
except meta.FieldDoesNotExist:
pass
else: