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
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- 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
- 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.
- 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
- 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
- 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
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class[source]
The form class for this update view
Form fields:
name
: Name (CharField
)common_id
: Community identification number (CharField
)slug
: URL parameter (SlugField
)events_enabled
: Activate events (BooleanField
)locations_enabled
: Activate locations (BooleanField
)chat_enabled
: Activate author chat (BooleanField
)push_notifications_enabled
: Activate push notifications (BooleanField
)latitude
: Latitude (FloatField
)longitude
: Longitude (FloatField
)longitude_min
: Minimum longitude (FloatField
)latitude_min
: Minimum latitude (FloatField
)longitude_max
: Maximum longitude (FloatField
)latitude_max
: Maximum latitude (FloatField
)postal_code
: Postal code (CharField
)admin_mail
: Email address of the administrator (EmailField
)statistics_enabled
: Activate statistics (BooleanField
)matomo_id
: Matomo ID (IntegerField
)matomo_token
: Matomo authentication token (CharField
)status
: Status (TypedChoiceField
)page_permissions_enabled
: Activate page-specific permissions (BooleanField
)administrative_division
: Administrative division (TypedChoiceField
)aliases
: Aliases (JSONField
)icon
: Logo (ModelChoiceField
)administrative_division_included
: Include administrative division into name (BooleanField
)offers
: Offers (ModelMultipleChoiceField
)short_urls_enabled
: Activate short urls (BooleanField
)seo_enabled
: Activate SEO section (BooleanField
)custom_prefix
: Custom prefix (CharField
)external_news_enabled
: Enable external news (BooleanField
)timezone
: Timezone (CharField
)fallback_translations_enabled
: Show content in default language as fallback (BooleanField
)summ_ai_enabled
: Activate automatic translations via SUMM.AI (BooleanField
)hix_enabled
: Activate HIX analysis (BooleanField
)mt_renewal_month
: Credits renewal date for foreign language translation (TypedChoiceField
)mt_addon_booked
: Add-on package for foreign languages booked (BooleanField
)mt_midyear_start_month
: Budget year start date for foreign language translation (TypedChoiceField
)integreat_chat_enabled
: Enable Integreat Chat (BooleanField
)zammad_url
: Zammad-URL (URLField
)zammad_access_token
: Zammad access token (CharField
)zammad_webhook_token
: Token used by Zammad webhook (UUIDField
)zammad_chat_handlers
: Zammad chat handlers (CharField
)chat_beta_tester_percentage
: Chat beta tester percentage (IntegerField
)duplicated_region
: Copy languages, pages and media from another region (ModelChoiceField
)duplication_keep_status
: Keep publication status of pages (BooleanField
)duplication_keep_translations
: Copy languages and content translations (BooleanField
)duplication_pbo_behavior
: Page based offers cloning behavior (ChoiceField
)timezone_area
: Timezone area (ChoiceField
)mt_midyear_start_enabled
: Budget year start differs from the renewal date (BooleanField
)zammad_offers
: Zammad forms (ModelMultipleChoiceField
)
alias of
RegionForm
- form_invalid(form: CustomModelForm) HttpResponse [source]
Renders a response, providing the invalid form as context.
- Parameters:
form (CustomModelForm) – The invalid form instance
- Returns:
The rendered invalid form
- Return type:
HttpResponse
- form_valid(form: CustomModelForm) HttpResponseRedirect [source]
Saves the form instance, sets the current object for the view, and redirects to
get_success_url()
.- Parameters:
form (CustomModelForm) – The valid form instance
- Returns:
A redirection to the success url
- Return type:
HttpResponseRedirect
- 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
- get_context_data(**kwargs: Any) dict[str, Any] [source]
Returns a dictionary representing the template context (see
get_context_data()
).
- get_object(queryset=None)[source]
Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
- get_permission_denied_message()[source]
Override this method to override the permission_denied_message attribute.
- get_permission_required() tuple[str] [source]
Override this method to override the permission_required attribute.
- get_queryset()[source]
Return the QuerySet that will be used to look up the object.
This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- get_redirect_field_name()[source]
Override this method to override the redirect_field_name attribute.
- get_success_url() str [source]
Determine the URL to redirect to when the form is successfully validated
- Returns:
The url to redirect on success
- Return type:
- 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.
- property model: ModelBase[source]
Return the model class of this form mixin
- Returns:
The corresponding Django model
- 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
- 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
- property template_name: str[source]
Return the template name to be used for the request.
- Returns:
The template to be rendered