Regions

This package contains all views related to regions

Region Actions

This module contains view actions for region objects.

integreat_cms.cms.views.regions.region_actions.delete_region(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponseRedirect[source]

This view deletes a region. All content is cascade deleted. Region users, who are not assigned to any other region, are manually removed.

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

A redirection to the media library

Return type:

HttpResponseRedirect

Region List View

class integreat_cms.cms.views.regions.region_list_view.RegionListView(**kwargs)[source]

Bases: TemplateView

View for listing regions

extra_context = {'current_menu_item': 'regions'}[source]

The context dict passed to the template (see ContextMixin)

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

Render region 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

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

Apply the query and filter the rendered regions

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

template_name = 'regions/region_list.html'[source]

The template to render (see TemplateResponseMixin)

Region Update View

class integreat_cms.cms.views.regions.region_update_view.RegionUpdateView(**kwargs)[source]

Bases: CustomUpdateView

View for updating regions

form_class[source]

The form class for this update view

Form fields:

alias of RegionForm

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

Render region form for HTTP GET requests

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

The rendered template response

Return type:

TemplateResponse

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

Updates region and removes mirrored pages from all pages of the region when it gets archived

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

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

Returns:

The rendered template response

Return type:

HttpResponseRedirect