web.mixins package¶
web.mixins package containing forms for the Eonvelope webapp views.
- class web.mixins.CustomActionMixin[source]¶
Bases:
objectMixin to provide action button handling for views.
To register handlers for the different actions define a viewclass method handle_action that creates the appropriate response to a action post request.
- _handler_method_prefix: Final[str] = 'handle_'¶
The name prefix of methods considered request handlers.
- post(request)[source]¶
Creates response to a post request.
If no action matches the existing handlers, responds with Http204. Should be executed last in a custom view post method.
- Parameters:
request (
HttpRequest) – The post request to handle.- Return type:
- Returns:
The handlers response to the request. If no matching handler is found Http204.
- Raises:
ImproperlyConfigured – If the called handler method does not return a
django.http.HttpResponse.>
- class web.mixins.PageSizeMixin[source]¶
Bases:
objectMixin for pagination with variable page size.
- page_size_kwarg = 'page_size'¶
- paginate_by = 25¶
- class web.mixins.TestActionMixin[source]¶
Bases:
objectMixin to provide test button handling for views.
- handle_test(request)[source]¶
Handler function for the test action.
- Parameters:
request (
HttpRequest) – The action request to handle.- Return type:
- Returns:
A template response with the updated view after the action.