1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

newforms-admin: Changed list_filter implementation to use ModelAdmin instead of AdminOptions. Also removed list_filter and list_display from AdminOptions entirely.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2007-01-16 00:21:01 +00:00
parent dbacd7de2d
commit f5441534e3
5 changed files with 12 additions and 13 deletions

View File

@@ -34,6 +34,7 @@ class ModelAdmin(object):
"Encapsulates all admin options and functionality for a given model."
list_display = ('__str__',)
list_filter = ()
def __init__(self, model):
self.model = model
@@ -269,7 +270,7 @@ class ModelAdmin(object):
if not self.has_change_permission(request, None):
raise PermissionDenied
try:
cl = ChangeList(request, self.model, self.list_display)
cl = ChangeList(request, self.model, self.list_display, self.list_filter)
except IncorrectLookupParameters:
# Wacky lookup parameters were given, so redirect to the main
# changelist page, without parameters, and pass an 'invalid=1'