Django

Code

Show
Ignore:
Timestamp:
07/18/08 15:23:02 (6 months ago)
Author:
brosner
Message:

newforms-admin: Moved contrib ModelAdmin? classes to an admin.py file in their respective apps. This is allowed since [7872].

Files:

Legend:

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

    r7809 r7953  
    2727    def get_absolute_url(self): 
    2828        return self.url 
    29  
    30 # Register the admin options for these models. 
    31 # TODO: Maybe this should live in a separate module admin.py, but how would we 
    32 # ensure that module was loaded? 
    33  
    34 from django.contrib import admin 
    35  
    36 class FlatPageAdmin(admin.ModelAdmin): 
    37     fieldsets = ( 
    38         (None, {'fields': ('url', 'title', 'content', 'sites')}), 
    39         (_('Advanced options'), {'classes': ('collapse',), 'fields': ('enable_comments', 'registration_required', 'template_name')}), 
    40     ) 
    41     list_display = ('url', 'title') 
    42     list_filter = ('sites', 'enable_comments', 'registration_required') 
    43     search_fields = ('url', 'title') 
    44  
    45 admin.site.register(FlatPage, FlatPageAdmin)