blog/admin.py @ a3380ed37242

Cleanup Tuesdays - Removed the photoblog, removed the silly ProjectPhoto thing too.
author Steve Losh <steve@stevelosh.com>
date Tue, 24 Mar 2009 17:57:23 -0400
parents c6f37ebd2f3e
children dbf5fe560ec3
from stevelosh.blog.models import Entry, Comment
from django.contrib import admin

class EntryAdmin(admin.ModelAdmin):
    fieldsets = [
        ('Entry', { 'fields': ['title', 'snip', 'body'], }),
        ('Publishing', { 'fields': ['pub_date', 'published'],
                         'description': "The entry won't be shown on the site unless the Published box is checked." }),
        ('Advanced', { 'fields': ['slug',],
                       'classes': ['collapse'], }),
    ]
    list_display = ('title', 'snip', 'pub_date',)
    search_fields = ('title', 'snip', 'body')
    list_filter = ('pub_date',)
    date_hierarchy = 'pub_date'
    ordering = ('-pub_date',)
    prepopulated_fields = { 'slug': ('title',) }

class CommentAdmin(admin.ModelAdmin):
    fields = ('name', 'body', 'submitted', 'entry', 'spam')
    list_display = ('entry', 'name', 'submitted', 'body', 'spam')
    search_fields = ('name', 'body')
    list_filter = ('name', 'entry', 'spam')
    date_hierarchy = 'submitted'
    ordering = ('-submitted',)


admin.site.register(Entry, EntryAdmin)
admin.site.register(Comment, CommentAdmin)