Minor bugfix: moved ConstantEmbedNode DoesNotExist reraising so that it actually...
[philo.git] / contrib / penfield / admin.py
1 from django.contrib import admin
2 from philo.admin import EntityAdmin
3 from philo.contrib.penfield.models import BlogEntry, Blog, BlogView, Newsletter, NewsletterArticle, NewsletterIssue, NewsletterView
4
5
6 class TitledAdmin(EntityAdmin):
7         prepopulated_fields = {'slug': ('title',)}
8         list_display = ('title', 'slug')
9
10
11 class BlogAdmin(TitledAdmin):
12         pass
13
14
15 class BlogEntryAdmin(TitledAdmin):
16         filter_horizontal = ['tags']
17
18
19 class BlogViewAdmin(EntityAdmin):
20         pass
21
22
23 class NewsletterAdmin(TitledAdmin):
24         pass
25
26
27 class NewsletterArticleAdmin(TitledAdmin):
28         pass
29
30
31 class NewsletterIssueAdmin(TitledAdmin):
32         filter_horizontal = TitledAdmin.filter_horizontal + ('articles',)
33
34
35 class NewsletterViewAdmin(EntityAdmin):
36         pass
37
38
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)