Django

Code

Changeset 4951

Show
Ignore:
Timestamp:
04/06/07 23:39:05 (2 years ago)
Author:
adrian
Message:

newforms-admin: Converted django.contrib.sites model admin options to use new syntax

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/contrib/sites/models.py

    r4265 r4951  
    1111    name = models.CharField(_('display name'), maxlength=50) 
    1212    objects = SiteManager() 
     13 
    1314    class Meta: 
    1415        db_table = 'django_site' 
     
    1617        verbose_name_plural = _('sites') 
    1718        ordering = ('domain',) 
    18     class Admin: 
    19         list_display = ('domain', 'name') 
    20         search_fields = ('domain', 'name') 
    2119 
    2220    def __str__(self): 
    2321        return self.domain 
     22 
     23# Register the admin options for these models. 
     24# TODO: Maybe this should live in a separate module admin.py, but how would we 
     25# ensure that module was loaded? 
     26 
     27from django.contrib import admin 
     28 
     29class SiteAdmin(admin.ModelAdmin): 
     30    list_display = ('domain', 'name') 
     31    search_fields = ('domain', 'name') 
     32 
     33admin.site.register(Site, SiteAdmin)