Django

Code

Show
Ignore:
Timestamp:
07/19/08 08:30:47 (6 months ago)
Author:
jbronn
Message:

gis: Merged revisions 7921,7926-7928,7938-7941,7945-7947,7949-7950,7952,7955-7956,7961,7964-7968,7970-7978 via svnmerge from trunk.

This includes the newforms-admin branch, and thus is backwards-incompatible. The geographic admin is _not_ in this changeset, and is forthcoming.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis

    • Property svnmerge-integrated changed from /django/trunk:1-7917 to /django/trunk:1-7978
  • django/branches/gis/django/contrib/redirects/models.py

    r7768 r7979  
    44 
    55class Redirect(models.Model): 
    6     site = models.ForeignKey(Site, radio_admin=models.VERTICAL
     6    site = models.ForeignKey(Site
    77    old_path = models.CharField(_('redirect from'), max_length=200, db_index=True, 
    88        help_text=_("This should be an absolute path, excluding the domain name. Example: '/events/search/'.")) 
     
    1616        unique_together=(('site', 'old_path'),) 
    1717        ordering = ('old_path',) 
     18     
     19    def __unicode__(self): 
     20        return "%s ---> %s" % (self.old_path, self.new_path) 
    1821 
    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? 
    2325 
    24     def __unicode__(self): 
    25         return u"%s ---> %s" % (self.old_path, self.new_path) 
     26from django.contrib import admin 
     27 
     28class 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 
     34admin.site.register(Redirect, RedirectAdmin) 
     35