django_powerbank.views package

Submodules

django_powerbank.views.auth module

class django_powerbank.views.auth.AbstractAccessView(**kwargs)[source]

Bases: django_powerbank.views.ExceptionResponseView

Allows you to handle authorization before dispatch is called

check_authorization(*args, **kwargs)[source]
dispatch(request, *args, **kwargs)[source]
class django_powerbank.views.auth.AbstractAuthorizedView(**kwargs)[source]

Bases: django_powerbank.views.auth.AuthenticatedView

check_authorization(*args, **kwargs)[source]
forbidden_message = 'You are not authorized to view this page'
get_forbidden_message()[source]
handle_forbidden()[source]
is_authorized(*args, **kwargs)[source]
django_powerbank.views.auth.AccessMixin

alias of django_powerbank.views.auth.AuthenticatedView

class django_powerbank.views.auth.AuthenticatedView(**kwargs)[source]

Bases: django_powerbank.views.auth.AbstractAccessView

redirects unauthenticated users to login

check_authorization(*args, **kwargs)[source]
handle_anonymous(*args, **kwargs)[source]
is_authenticated(*args, **kwargs)[source]
class django_powerbank.views.auth.StaffRequiredMixin(**kwargs)[source]

Bases: django_powerbank.views.auth.AbstractAuthorizedView

is_authorized(*args, **kwargs)[source]

django_powerbank.views.generic module

class django_powerbank.views.generic.FilterMixin[source]

Bases: django.views.generic.list.MultipleObjectMixin

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

django_powerbank.views.mixins module

class django_powerbank.views.mixins.ReturnUrlMx(**kwargs)[source]

Bases: django.views.generic.base.ContextMixin, django.views.generic.base.View

dispatch(request, *args, **kwargs)[source]

Does request processing for return_url query parameter and redirects with it’s missing

We can’t do that in the get method, as it does not exist in the View base class and child mixins implementing get do not call super().get

get_context_data(**kwargs)[source]
get_success_url()[source]

Module contents

exception django_powerbank.views.ExceptionResponse(response)[source]

Bases: Exception

Generic exception for signalling that instead of default error handling we should use attached response

class django_powerbank.views.ExceptionResponseView(**kwargs)[source]

Bases: django.views.generic.base.View

dispatch(request, *args, **kwargs)[source]
exception django_powerbank.views.Http302(to, *args, **kwargs)[source]

Bases: django_powerbank.views.ExceptionResponse

Wraps a redirect shortcut call into the ResponseException

exception django_powerbank.views.Http400(response)[source]

Bases: django_powerbank.views.ExceptionResponse

exception django_powerbank.views.Http401(response)[source]

Bases: django_powerbank.views.ExceptionResponse

exception django_powerbank.views.Http403(response)[source]

Bases: django.core.exceptions.PermissionDenied, django_powerbank.views.ExceptionResponse

A convenience wrapper around :py:class:~django.core.exceptions.PermissionDenied`