Controller

class djmvc.controller.Controller[source]

Bases: Clonable, Route

Group child routes under a shared URL prefix.

routes

Declared child routes (classes or instances). Before build(), this is the declaration list; afterward it is a Registry of built route instances.

icon

Bootstrap Icons name for the sidebar entry. Navigation list views inherit this when they do not set their own icon.

Type:

str

color

Bulma color name for the sidebar icon (primary, info, …).

Type:

str

build()[source]

Instantiate child routes into a Registry.

property codename

URL segment with the controller suffix removed from the class name.

find_route(codename)[source]

Walk up the controller tree and return the first route named codename.

property model_controller

Nearest ancestor ModelController, or self.

has_permission(view)[source]

Delegate permission checks to the nearest ModelController.

get_tagged_views(tag, **kwargs)[source]

Return permitted child views whose tags contain tag.

property root

Topmost controller ancestor.

property urlpatterns

Include child urlpatterns under this prefix.