From 9cbaed5efc17cdcd3382a8e8127c44e22e2f79ab Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 7 Apr 2007 04:38:09 +0000 Subject: [PATCH] newforms-admin: Converted django.contrib.redirects model admin options to use new syntax git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4950 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/redirects/models.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/django/contrib/redirects/models.py b/django/contrib/redirects/models.py index 60205e29f3..a69cc5d31a 100644 --- a/django/contrib/redirects/models.py +++ b/django/contrib/redirects/models.py @@ -16,9 +16,17 @@ class Redirect(models.Model): unique_together=(('site', 'old_path'),) ordering = ('old_path',) - class Admin: - list_filter = ('site',) - search_fields = ('old_path', 'new_path') - def __str__(self): return "%s ---> %s" % (self.old_path, self.new_path) + +# Register the admin options for these models. +# TODO: Maybe this should live in a separate module admin.py, but how would we +# ensure that module was loaded? + +from django.contrib import admin + +class RedirectAdmin(admin.ModelAdmin): + list_filter = ('site',) + search_fields = ('old_path', 'new_path') + +admin.site.register(Redirect, RedirectAdmin)