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) -