Model mixin

class djmvc.model.ModelMixin[source]

Bases: object

Resolve model and scoped querysets from the enclosing controller.

Views nested under a ModelController inherit its model and get_queryset() scoping.

property title

Human-readable label with the model class name removed.

property codename

URL segment with the model name removed from the default codename.

property model

Django model from the nearest ancestor ModelController.

property model_meta

model._meta exposed for templates (._meta is blocked).

get_object_queryset()[source]

Scoped model rows for resolving self.object from the URL.

get_queryset()[source]

Scoped queryset for list and action views.

breadcrumbs(with_self=True)[source]

Breadcrumb trail via list view, optionally including this view.