from validators import TreeParentValidator, TreePositionValidator
+COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
+
+
class AttributeInline(generic.GenericTabularInline):
ct_field = 'entity_content_type'
ct_fk_field = 'entity_object_id'
fk_name = 'collection'
model = CollectionMember
extra = 1
- classes = ('collapse-closed',)
+ classes = COLLAPSE_CLASSES
allow_add = True
fields = ('member_content_type', 'member_object_id', 'index',)
'fields': ('parent', 'name', 'slug')
}),
('Documentation', {
- 'classes': ('collapse', 'collapse-closed'),
+ 'classes': COLLAPSE_CLASSES,
'fields': ('documentation',)
}),
(None, {
'fields': ('code',)
}),
('Advanced', {
- 'classes': ('collapse','collapse-closed'),
+ 'classes': COLLAPSE_CLASSES,
'fields': ('mimetype',)
}),
)
'fields': ('slug', 'target', 'status_code')
}),
('URL/Tree/Hierarchy', {
- 'classes': ('collapse', 'collapse-closed'),
+ 'classes': COLLAPSE_CLASSES,
'fields': ('parent',)
}),
)
'fields': ('file', 'slug', 'mimetype')
}),
('URL/Tree/Hierarchy', {
- 'classes': ('collapse', 'collapse-closed'),
+ 'classes': COLLAPSE_CLASSES,
'fields': ('parent',)
}),
)
'fields': ('title', 'slug', 'template')
}),
('URL/Tree/Hierarchy', {
- 'classes': ('collapse', 'collapse-closed'),
+ 'classes': COLLAPSE_CLASSES,
'fields': ('parent',)
}),
)
contentreference.save()
+class RedirectAdmin(admin.ModelAdmin):
+ list_display=('slug', 'target', 'path', 'status_code',)
+ list_filter=('status_code',)
+ form = RedirectAdminForm
+
+
+class FileAdmin(admin.ModelAdmin):
+ form=FileAdminForm
+ list_display=('slug', 'mimetype', 'path', 'file',)
+
+
admin.site.register(Collection, CollectionAdmin)
admin.site.register(Redirect, RedirectAdmin)
admin.site.register(File, FileAdmin)