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 and the region’s media files are removed from the file system. 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

integreat_cms.cms.views.regions.region_actions.release_api_management(request: HttpRequest, slug: str) → HttpResponseRedirect[source]

This view releases a region from being managed by an external system via the API.

It only clears api_settings_synced_at, which is what marks a region as API-managed and makes the synced settings read-only in the region form. Nothing else is changed: the settings themselves keep the values the external system pushed last.

The release is deliberately not permanent. If the connected system pushes again, the region is marked as API-managed once more and the fields become read-only again – which is the desired semantics: the release states “we maintain these settings here from now on”, and a subsequent push visibly contradicts that instead of failing silently.

Parameters:
  • request (HttpRequest) – The current request

  • slug (str) – The slug of the region

Returns:

A redirection to the region form

Return type:

HttpResponseRedirect

Region List View

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

Bases: TemplateView, FilterSortMixin, PaginationMixin

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

model[source]

alias of Region

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