summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-04-07 04:38:09 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-04-07 04:38:09 +0000
commit9cbaed5efc17cdcd3382a8e8127c44e22e2f79ab (patch)
treef22d99672334dc961aa6449ecb9f902af4fce493
parentd6d173f8e1fab286522abf7764fcfeb1e87ef380 (diff)
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
-rw-r--r--django/contrib/redirects/models.py16
1 files 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)