AKModel.metaviews.admin module
- class AKModel.metaviews.admin.EventSlugMixin[source]
Bases:
objectMixin 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:
EventSlugMixinMixin to filter different querysets based on a event slug from the request url
- class AKModel.metaviews.admin.AdminViewMixin[source]
Bases:
objectMixin 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,FormViewMetaview: Handle typical “action but with preview and confirmation step before” workflow
- form_class
alias of
AdminIntermediateForm
- class AKModel.metaviews.admin.WizardViewMixin[source]
Bases:
objectMixin to create wizard-like views. This visualizes the progress of the user in the creation process and provides the interlinking to the next step
A concrete wizard should define a subclass of this mixin that specifies
wizard_titleand the list ofwizard_steps(see e.g.AKModel.views.event_wizard.NewEventWizardMixin). Each view of the wizard then uses that subclass and specifies its (1-based) position in the wizard aswizard_step. Wizards whose steps can be revisited can overrideget_wizard_step_url(), previous steps are then linked in the navigation.
- class AKModel.metaviews.admin.IntermediateAdminActionView(**kwargs)[source]
Bases:
IntermediateAdminView,ABCAbstract 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.
Instead of the object list, the view can also redirect to another (local) page after performing the action, specified via the GET parameter
next(e.g., to return to the page the action was started from)- form_class
alias of
AdminIntermediateActionForm
- class AKModel.metaviews.admin.LoopActionMixin[source]
Bases:
ABCMixin 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