mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user