AKModel.metaviews.admin module
- class AKModel.metaviews.admin.EventSlugMixin[source]
Bases:
object
Mixin to handle views with event slugs
This will make the relevant event available as self.event in all kind types of requests (generic GET and POST views, list views, dispatching, create views)
- post(request, *args, **kwargs)[source]
Override POST request handling to perform loading event first
- list(request, *args, **kwargs)[source]
Override list view request handling to perform loading event first
- create(request, *args, **kwargs)[source]
Override create view request handling to perform loading event first
- class AKModel.metaviews.admin.FilterByEventSlugMixin[source]
Bases:
EventSlugMixin
Mixin to filter different querysets based on a event slug from the request url
- class AKModel.metaviews.admin.AdminViewMixin[source]
Bases:
object
Mixin to provide context information needed in custom admin views
Will either use default information for site_url and title or allows to set own values for that
- class AKModel.metaviews.admin.IntermediateAdminView(**kwargs)[source]
Bases:
AdminViewMixin
,FormView
Metaview: Handle typical “action but with preview and confirmation step before” workflow
- form_class
alias of
AdminIntermediateForm
- class AKModel.metaviews.admin.WizardViewMixin[source]
Bases:
object
Mixin to create wizard-like views. This visualizes the progress of the user in the creation process and provides the interlinking to the next step
In the current implementation, the steps of the wizard are hardcoded here, hence this mixin can only be used for the event creation wizard
- class AKModel.metaviews.admin.IntermediateAdminActionView(**kwargs)[source]
Bases:
IntermediateAdminView
,ABC
Abstract base view: Intermediate action view (preview & confirmation see
IntermediateAdminView
) for custom admin actions (marking multiple objects in a django admin model instances list with a checkmark and then choosing an action from the dropdown).This will automatically handle the decoding of the URL encoding of the list of primary keys django does to select which objects the action should be run on, then display a preview, perform the action after confirmation and redirect again to the object list including display of a confirmation message
- form_class
alias of
AdminIntermediateActionForm
- class AKModel.metaviews.admin.LoopActionMixin[source]
Bases:
ABC
Mixin for the typical kind of action where one needs to loop over all elements and perform a certain function on each of them
The action is performed by overriding perform_action(self, entity) further customization can be reached with the two callbacks pre_action() and post_action() that are called before and after performing the action loop
- action(form)[source]
The real action to perform. Will perform the loop, perform the action on each aelement and call the callbacks
- Parameters:
form – form holding the data probably needed for the action