From 4f1cbaa93e2684f900fb350267a6092ea8c2bd95 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Mon, 21 Jul 2008 16:01:05 +0000 Subject: [PATCH] Moved RedirectAdmin in django.contrib.redirects to an admin.py module. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8018 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/redirects/admin.py | 11 +++++++++++ django/contrib/redirects/models.py | 15 --------------- 2 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 django/contrib/redirects/admin.py diff --git a/django/contrib/redirects/admin.py b/django/contrib/redirects/admin.py new file mode 100644 index 0000000000..a9b2a3228f --- /dev/null +++ b/django/contrib/redirects/admin.py @@ -0,0 +1,11 @@ + +from django.contrib import admin +from django.contrib.redirects.models import Redirect + +class RedirectAdmin(admin.ModelAdmin): + list_display = ('old_path', 'new_path') + list_filter = ('site',) + search_fields = ('old_path', 'new_path') + radio_fields = {'site': admin.VERTICAL} + +admin.site.register(Redirect, RedirectAdmin) \ No newline at end of file diff --git a/django/contrib/redirects/models.py b/django/contrib/redirects/models.py index 991423268d..4233d55793 100644 --- a/django/contrib/redirects/models.py +++ b/django/contrib/redirects/models.py @@ -18,18 +18,3 @@ class Redirect(models.Model): def __unicode__(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_display = ('old_path', 'new_path') - list_filter = ('site',) - search_fields = ('old_path', 'new_path') - radio_fields = {'site': admin.VERTICAL} - -admin.site.register(Redirect, RedirectAdmin) -