Django

Code

Changeset 7953

Show
Ignore:
Timestamp:
07/18/08 15:23:02 (4 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/auth/models.py

    r7809 r7953  
    370370    def is_authenticated(self): 
    371371        return False 
    372  
    373 # Register the admin options for these models. 
    374 from django.contrib.auth import admin 
  • django/branches/newforms-admin/django/contrib/comments/models.py

    r7211 r7953  
    284284    def __unicode__(self): 
    285285        return _("Moderator deletion by %r") % self.user 
    286  
    287 # Register the admin options for these models. 
    288 # TODO: Maybe this should live in a separate module admin.py, but how would we 
    289 # ensure that module was loaded? 
    290  
    291 from django.contrib import admin 
    292  
    293 class CommentAdmin(admin.ModelAdmin): 
    294     fieldsets = ( 
    295         (None, {'fields': ('content_type', 'object_id', 'site')}), 
    296         ('Content', {'fields': ('user', 'headline', 'comment')}), 
    297         ('Ratings', {'fields': ('rating1', 'rating2', 'rating3', 'rating4', 'rating5', 'rating6', 'rating7', 'rating8', 'valid_rating')}), 
    298         ('Meta', {'fields': ('is_public', 'is_removed', 'ip_address')}), 
    299     ) 
    300     list_display = ('user', 'submit_date', 'content_type', 'get_content_object') 
    301     list_filter = ('submit_date',) 
    302     date_hierarchy = 'submit_date' 
    303     search_fields = ('comment', 'user__username') 
    304     raw_id_fields = ('user',) 
    305  
    306 class FreeCommentAdmin(admin.ModelAdmin): 
    307     fieldsets = ( 
    308         (None, {'fields': ('content_type', 'object_id', 'site')}), 
    309         ('Content', {'fields': ('person_name', 'comment')}), 
    310         ('Meta', {'fields': ('is_public', 'ip_address', 'approved')}), 
    311     ) 
    312     list_display = ('person_name', 'submit_date', 'content_type', 'get_content_object') 
    313     list_filter = ('submit_date',) 
    314     date_hierarchy = 'submit_date' 
    315     search_fields = ('comment', 'person_name') 
    316  
    317 admin.site.register(Comment, CommentAdmin) 
    318 admin.site.register(FreeComment, FreeCommentAdmin) 
     286         
  • 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) 
  • django/branches/newforms-admin/django/contrib/sites/models.py

    r7730 r7953  
    5050        except KeyError: 
    5151            pass 
    52      
    53 # Register the admin options for these models. 
    54 # TODO: Maybe this should live in a separate module admin.py, but how would we 
    55 # ensure that module was loaded? 
    56  
    57 from django.contrib import admin 
    58  
    59 class SiteAdmin(admin.ModelAdmin): 
    60     list_display = ('domain', 'name') 
    61     search_fields = ('domain', 'name') 
    62  
    63 admin.site.register(Site, SiteAdmin) 
    6452 
    6553class RequestSite(object):