Events
This package contains all views related to events
Event Actions
This module contains action methods for events (archive, restore, …)
- integreat_cms.cms.views.events.event_actions.archive(request: HttpRequest, event_id: int, region_slug: str, language_slug: str) HttpResponseRedirect [source]
Set archived flag for an event
- Parameters:
- Returns:
The rendered template response
- Return type:
HttpResponseRedirect
- integreat_cms.cms.views.events.event_actions.copy(request: HttpRequest, event_id: int, region_slug: str, language_slug: str) HttpResponseRedirect [source]
Duplicates the given event and all of its translations.
- Parameters:
- Returns:
The rendered template response
- Return type:
HttpResponseRedirect
- integreat_cms.cms.views.events.event_actions.delete(request: HttpRequest, event_id: int, region_slug: str, language_slug: str) HttpResponseRedirect [source]
Delete a single event
- Parameters:
- Returns:
The rendered template response
- Return type:
HttpResponseRedirect
- integreat_cms.cms.views.events.event_actions.restore(request: HttpRequest, event_id: int, region_slug: str, language_slug: str) HttpResponseRedirect [source]
Remove archived flag for an event
- Parameters:
- Returns:
The rendered template response
- Return type:
HttpResponseRedirect
- integreat_cms.cms.views.events.event_actions.search_poi_ajax(request: HttpRequest, region_slug: str) HttpResponse [source]
AJAX endpoint for searching POIs
- Parameters:
request (HttpRequest) – Object representing the user call
region_slug (str) – The current regions slug
- Returns:
The rendered template response
- Return type:
HttpResponse
Event Context Mixin
- class integreat_cms.cms.views.events.event_context_mixin.EventContextMixin[source]
Bases:
ContextMixin
This mixin provides extra context for event views
Event Form View
- class integreat_cms.cms.views.events.event_form_view.EventFormView(**kwargs)[source]
Bases:
TemplateView
,EventContextMixin
,MediaContextMixin
,ContentEditLockMixin
Class for rendering the events form
- back_url_name: str | None = 'events'[source]
The url name of the view to show if the user decides to go back (see
ContentEditLockMixin
- extra_context = {'translation_status': <module 'integreat_cms.cms.constants.translation_status' from '/home/circleci/project/integreat_cms/cms/constants/translation_status.py'>}[source]
The context dict passed to the template (see
ContextMixin
)
- get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Render event form for HTTP GET requests
- Parameters:
request (HttpRequest) – Object representing the user call
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
The rendered template response
- Return type:
HttpResponse
- post(request: HttpRequest, **kwargs: Any) HttpResponse [source]
Save event and ender event form for HTTP POST requests
- Parameters:
request (HttpRequest) – Object representing the user call
**kwargs (Any) – The supplied keyword arguments
- Raises:
PermissionDenied – If user does not have the permission to publish events
- Returns:
The rendered template response
- Return type:
HttpResponse
- template_name = 'events/event_form.html'[source]
The template to render (see
TemplateResponseMixin
)
Event List View
- class integreat_cms.cms.views.events.event_list_view.EventListView(**kwargs)[source]
Bases:
TemplateView
,EventContextMixin
,MachineTranslationContextMixin
View for listing events (either non-archived or archived events depending on
archived
)- archived = False[source]
Whether or not to show archived events
- get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponse [source]
Render events list for HTTP GET requests
- Parameters:
request (HttpRequest) – Object representing the user call
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
The rendered template response
- Return type:
HttpResponse
- template = 'events/event_list.html'[source]
Template for list of non-archived events
- template_archived = 'events/event_list_archived.html'[source]
Template for list of archived events
- property template_name: str[source]
Select correct HTML template, depending on
archived
flag (seeTemplateResponseMixin
)- Returns:
Path to HTML template
- translation_model[source]
The translation model of this list view (used to determine whether machine translations are permitted)
- Parameters:
id (BigAutoField) – Primary key: ID
title (TruncatingCharField) – Title of the event
slug (SlugField) – Event link. String identifier without spaces and special characters. Unique per region and language. Leave blank to generate unique parameter from title.
status (CharField) – Status
content (TextField) – Description
currently_in_translation (BooleanField) – Currently in translation. Flag to indicate a translation is being updated by an external translator
machine_translated (BooleanField) – Machine translated. Flag to indicate whether a translations is machine translated
version (PositiveIntegerField) – Revision
minor_edit (BooleanField) – Minor edit. Tick if this change does not require an update of translations in other languages.
last_updated (DateTimeField) – Modification date
automatic_translation (BooleanField) – Automatic translation. Tick if updating this content should automatically refresh or create its translations.
Relationship fields:
- Parameters:
language (
ForeignKey
toLanguage
) – Language (related name:event_translations
)creator (
ForeignKey
toUser
) – Creator (related name:event_translations
)event (
ForeignKey
toEvent
) – Event (related name:translations
)links (
GenericRelation
toLink
) – Links (related name:event_translation
)
Reverse relationships:
- Parameters:
feedback (Reverse
ForeignKey
fromEventFeedback
) – All feedback of this event translation (related name ofevent_translation
)
alias of
EventTranslation
Event Version View
- class integreat_cms.cms.views.events.event_version_view.EventVersionView(**kwargs)[source]
Bases:
EventContextMixin
,ContentVersionView
View for browsing the event versions and restoring old event versions
- back_to_form_label: Promise = 'Back to the event form'[source]
The label of the “back to form” button
- model[source]
The current content model (see
SingleObjectMixin
)- Parameters:
id (BigAutoField) – Primary key: ID
created_date (DateTimeField) – Creation date
start (DateTimeField) – Start
end (DateTimeField) – End
archived (BooleanField) – Archived
external_event_id (CharField) – The ID of this event in the external calendar
Relationship fields:
- Parameters:
region (
ForeignKey
toRegion
) – Region (related name:events
)location (
ForeignKey
toPOI
) – Location (related name:events
)recurrence_rule (
OneToOneField
toRecurrenceRule
) –Recurrence rule (related name:
event
)If the event is recurring, the recurrence rule contains all necessary information on the frequency, interval etc. which is needed to calculate the single instances of a recurring event
icon (
ForeignKey
toMediaFile
) – Icon (related name:events
)external_calendar (
ForeignKey
toExternalCalendar
) – External calendar (related name:events
)
Reverse relationships:
- Parameters:
translations (Reverse
ForeignKey
fromEventTranslation
) – All translations of this event (related name ofevent
)
alias of
Event