1 from django.contrib import admin
2 from philo.admin import EntityAdmin, AddTagAdmin
3 from philo.contrib.penfield.models import BlogEntry, Blog, BlogView, Newsletter, NewsletterArticle, NewsletterIssue, NewsletterView
6 class TitledAdmin(EntityAdmin):
7 prepopulated_fields = {'slug': ('title',)}
8 list_display = ('title', 'slug')
11 class BlogAdmin(TitledAdmin):
15 class BlogEntryAdmin(TitledAdmin, AddTagAdmin):
16 filter_horizontal = ['tags']
19 class BlogViewAdmin(EntityAdmin):
23 class NewsletterAdmin(TitledAdmin):
27 class NewsletterArticleAdmin(TitledAdmin, AddTagAdmin):
28 filter_horizontal = TitledAdmin.filter_horizontal + ('tags', 'authors')
31 class NewsletterIssueAdmin(TitledAdmin):
32 filter_horizontal = TitledAdmin.filter_horizontal + ('articles',)
35 class NewsletterViewAdmin(EntityAdmin):
39 admin.site.register(Blog, BlogAdmin)
40 admin.site.register(BlogEntry, BlogEntryAdmin)
41 admin.site.register(BlogView, BlogViewAdmin)
42 admin.site.register(Newsletter, NewsletterAdmin)
43 admin.site.register(NewsletterArticle, NewsletterArticleAdmin)
44 admin.site.register(NewsletterIssue, NewsletterIssueAdmin)
45 admin.site.register(NewsletterView, NewsletterViewAdmin)