Admin classes (feincms3.admin)¶
- class feincms3.admin.AncestorFilter(request, params, model, model_admin)[source]¶
Only show the subtree of an ancestor
By default, the first two levels are shown in the
list_filtersidebar. This can be changed by setting themax_depthclass attribute to a different value.Usage:
class NodeAdmin(TreeAdmin): list_display = ("indented_title", "move_column", ...) list_filter = ("is_active", AncestorFilter, ...) admin.site.register(Node, NodeAdmin)
- class feincms3.admin.CloneForm(*args, **kwargs)[source]¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- property media¶
Return all media required to render the widgets on this form.
- class feincms3.admin.MoveForm(*args, **kwargs)[source]¶
Allows making the node the left or right sibling or the first or last child of another node.
Requires the node to be moved as
objkeyword argument.- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- property media¶
Return all media required to render the widgets on this form.
- class feincms3.admin.TreeAdmin(model, admin_site)[source]¶
-
- position_field = 'position'¶
ModelAdminsubclass for managing models using django-tree-queries trees.Shows the tree’s hierarchy and adds a view to move nodes around. To use this class the three columns
collapse_column,indented_titleandmove_columnshould be added to subclasseslist_display:class NodeAdmin(TreeAdmin): list_display = [*TreeAdmin.list_display, ...] # This is the default: # list_display_links = ["indented_title"] admin.site.register(Node, NodeAdmin)