summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2008-09-21 16:57:26 +0000
committerKaren Tracey <kmtracey@gmail.com>2008-09-21 16:57:26 +0000
commitfd366a85315dfc836e73f9cdee3e7309281dfd3e (patch)
tree275648ffb20a93e8b5448009c0c5578ed36f6fc2 /django
parent0ededc611fd9c98812652f4853a0eebf96942da3 (diff)
Fixed #7582: Removed checks that prevented null=True ForeignKey fields from being sortable in Admin. Post queryset-refactor there seems no reason to disallow this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9080 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/templatetags/admin_list.py6
-rw-r--r--django/contrib/admin/views/main.py3
2 files changed, 2 insertions, 7 deletions
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
index 21e87f572b..93e9b0799b 100644
--- a/django/contrib/admin/templatetags/admin_list.py
+++ b/django/contrib/admin/templatetags/admin_list.py
@@ -116,11 +116,7 @@ def result_headers(cl):
# So this _is_ a sortable non-field. Go to the yield
# after the else clause.
else:
- if isinstance(f.rel, models.ManyToOneRel) and f.null:
- yield {"text": f.verbose_name}
- continue
- else:
- header = f.verbose_name
+ header = f.verbose_name
th_classes = []
new_order_type = 'asc'
diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py
index a6a206d1dc..bcfa3a8155 100644
--- a/django/contrib/admin/views/main.py
+++ b/django/contrib/admin/views/main.py
@@ -162,8 +162,7 @@ class ChangeList(object):
except AttributeError:
pass
else:
- if not isinstance(f.rel, models.ManyToOneRel) or not f.null:
- order_field = f.name
+ order_field = f.name
except (IndexError, ValueError):
pass # Invalid ordering specified. Just use the default.
if ORDER_TYPE_VAR in params and params[ORDER_TYPE_VAR] in ('asc', 'desc'):