Changeset 7967 for django/trunk/django/contrib/redirects/models.py
- Timestamp:
- 07/18/08 18:54:34 (4 months ago)
- Files:
-
- django/trunk/django/contrib/redirects/models.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/redirects/models.py
r7651 r7967 4 4 5 5 class Redirect(models.Model): 6 site = models.ForeignKey(Site , radio_admin=models.VERTICAL)6 site = models.ForeignKey(Site) 7 7 old_path = models.CharField(_('redirect from'), max_length=200, db_index=True, 8 8 help_text=_("This should be an absolute path, excluding the domain name. Example: '/events/search/'.")) … … 16 16 unique_together=(('site', 'old_path'),) 17 17 ordering = ('old_path',) 18 19 def __unicode__(self): 20 return "%s ---> %s" % (self.old_path, self.new_path) 18 21 19 class Admin: 20 list_display = ('old_path', 'new_path') 21 list_filter = ('site',) 22 search_fields = ('old_path', 'new_path') 22 # Register the admin options for these models. 23 # TODO: Maybe this should live in a separate module admin.py, but how would we 24 # ensure that module was loaded? 23 25 24 def __unicode__(self): 25 return u"%s ---> %s" % (self.old_path, self.new_path) 26 from django.contrib import admin 27 28 class RedirectAdmin(admin.ModelAdmin): 29 list_display = ('old_path', 'new_path') 30 list_filter = ('site',) 31 search_fields = ('old_path', 'new_path') 32 radio_fields = {'site': admin.VERTICAL} 33 34 admin.site.register(Redirect, RedirectAdmin) 35
