Model mixin

class djcrud.model.ModelMixin[source]

Bases: object

Resolve model and scoped querysets from the enclosing router.

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

You can also declare model = MyModel directly on a ListView (or subclass) to support patterns such as workspace sections, sharing tabs, or invitations lists mounted under a plain djcrud.Router (instead of a ModelRouter). The effective model is then used for both templates and queryset/permission registry lookups.

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 ModelRouter.

property model_meta

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

get_queryset()[source]

Scoped queryset for list and action views.

breadcrumbs(with_self=True)[source]

Breadcrumb trail via list view, optionally including this view.