1 from django.contrib import admin
2 from philo.admin.base import EntityAdmin, TreeEntityAdmin
3 from philo.models import Node, Redirect, File
6 class NodeAdmin(TreeEntityAdmin):
7 list_display = ('slug', 'view', 'accepts_subpath')
9 def accepts_subpath(self, obj):
10 return obj.accepts_subpath
11 accepts_subpath.boolean = True
14 class ViewAdmin(EntityAdmin):
18 class RedirectAdmin(ViewAdmin):
21 'fields': ('target', 'status_code')
24 list_display = ('target', 'status_code')
25 list_filter = ('status_code',)
28 class FileAdmin(ViewAdmin):
31 'fields': ('file', 'mimetype')
34 list_display = ('mimetype', 'file')
37 admin.site.register(Node, NodeAdmin)
38 admin.site.register(Redirect, RedirectAdmin)
39 admin.site.register(File, FileAdmin)