Users

This package contains all views related to users

Region User Actions

This module contains view actions for region user objects.

integreat_cms.cms.views.users.region_user_actions.delete_region_user(request: HttpRequest, region_slug: str, user_id: int) HttpResponseRedirect[source]

This view deletes a region user

Parameters:
  • request (HttpRequest) – The current request

  • region_slug (str) – The slug of the current region

  • user_id (int) – The id of the user which should be deleted

Returns:

A redirection to region user list

Return type:

HttpResponseRedirect

Resends an activation link to a region user

Parameters:
  • request (HttpRequest) – The current request

  • region_slug (str) – The slug of the current region

  • user_id (int) – users id to send the activation link

Returns:

A redirection to region user list

Return type:

HttpResponseRedirect

Region User Form View

class integreat_cms.cms.views.users.region_user_form_view.RegionUserFormView(**kwargs)[source]

Bases: TemplateView

View for the user form of region users

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = {'current_menu_item': 'region_user_form'}[source]

The context dict passed to the template (see ContextMixin)

get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render UserForm for region users

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

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

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Submit UserForm and save User object for region users

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

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

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'users/region_user_form.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

Region User List View

class integreat_cms.cms.views.users.region_user_list_view.RegionUserListView(**kwargs)[source]

Bases: TemplateView

View for listing region users

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = {'current_menu_item': 'region_users'}[source]

The context dict passed to the template (see ContextMixin)

get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render region user list

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

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

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Apply the query and filter the rendered users

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

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

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'users/region_user_list.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

User Actions

This module contains view actions for user objects.

integreat_cms.cms.views.users.user_actions.delete_user(request: HttpRequest, user_id: int) HttpResponseRedirect[source]

This view deletes a user

Parameters:
  • request (HttpRequest) – The current request

  • user_id (int) – The id of the user which should be deleted

Returns:

A redirection to user list

Return type:

HttpResponseRedirect

Resends an activation link to an user

Parameters:
  • request (HttpRequest) – The current request

  • user_id (int) – users id to send the activation link

Returns:

A redirection to region user list

Return type:

HttpResponseRedirect

User Form View

class integreat_cms.cms.views.users.user_form_view.UserFormView(**kwargs)[source]

Bases: TemplateView

View for the user form and user form

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = {'current_menu_item': 'user_form'}[source]

The context dict passed to the template (see ContextMixin)

get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render UserForm

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

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

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

post(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Submit UserForm and save User

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

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

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'users/user_form.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]

User List View

class integreat_cms.cms.views.users.user_list_view.UserListView(**kwargs)[source]

Bases: TemplateView

View for listing all users (admin users and region users)

__init__(**kwargs)[source]

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

classmethod as_view(**initkwargs)[source]

Main entry point for a request-response process.

content_type = None[source]
dispatch(request, *args, **kwargs)[source]
extra_context = {'current_menu_item': 'users'}[source]

The context dict passed to the template (see ContextMixin)

get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse[source]

Render user list

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponse

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

Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.

http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'][source]
http_method_not_allowed(request, *args, **kwargs)[source]
options(request, *args, **kwargs)[source]

Handle responding to requests for the OPTIONS HTTP verb.

render_to_response(context, **response_kwargs)[source]

Return a response, using the response_class for this view, with a template rendered with the given context.

Pass response_kwargs to the constructor of the response class.

response_class[source]

alias of TemplateResponse

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

Initialize attributes shared by all view methods.

template_engine = None[source]
template_name = 'users/user_list.html'[source]

The template to render (see TemplateResponseMixin)

view_is_async = False[source]