Events
Forms for creating or saving event objects and their corresponding event translation objects and recurrence rule objects
Event Filter Form
Form for submitting filter requests
- class integreat_cms.cms.forms.events.event_filter_form.EventFilterForm(**kwargs: Any)[source]
Bases:
CustomFilterForm
Form to filter the event list
Form fields:
all_day
: All Day (TypedMultipleChoiceField
)recurring
: Recurring (TypedMultipleChoiceField
)date_from
: Date From (DateField
)date_to
: Date To (DateField
)events_time_range
: Events Time Range (MultipleChoiceField
)poi_id
: Poi Id (IntegerField
)query
: Query (CharField
)
- Parameters:
kwargs (Any)
- apply(events: EventQuerySet, region: Region, language_slug: str) tuple[EventQuerySet, None, None] [source]
Filter the events according to the given filter data
- Parameters:
events (EventQuerySet) – The list of events
region (Region) – The current region
language_slug (str) – The slug of the current language
- Returns:
The filtered list of events, the poi used for filtering, and the search query
- Return type:
tuple[EventQuerySet, None, None]
- property media[source]
Return all media required to render the widgets on this form.
Event Form
- class integreat_cms.cms.forms.events.event_form.EventForm(**kwargs: Any)[source]
Bases:
CustomModelForm
Form for creating and modifying event objects
Form fields:
start
: Start (DateTimeField
)end
: End (DateTimeField
)icon
: Icon (ModelChoiceField
)location
: Location (ModelChoiceField
)external_calendar
: External calendar (ModelChoiceField
)external_event_id
: The ID of this event in the external calendar (CharField
)is_all_day
: All-day (BooleanField
)is_recurring
: Recurring (BooleanField
)has_not_location
: Event does not have a physical location (BooleanField
)start_date
: start date (DateField
)end_date
: end date (DateField
)start_time
: start time (TimeField
)end_time
: end time (TimeField
)
- Parameters:
kwargs (Any)
- __init__(**kwargs: Any) None [source]
Initialize event form
- Parameters:
**kwargs (Any) – The supplied keyword arguments
- Return type:
None
- clean() dict[str, Any] [source]
Validate form fields which depend on each other, see
django.forms.Form.clean()
- property media[source]
Return all media required to render the widgets on this form.
- save(commit: bool = True) Any [source]
This method extends the default
save()
-method of the baseModelForm
to provide debug logging- Parameters:
commit (bool) – Whether or not the changes should be written to the database
- Returns:
The saved object returned by The save() method
- Return type:
Any
Event Translation Form
- class integreat_cms.cms.forms.events.event_translation_form.EventTranslationForm(**kwargs: Any)[source]
Bases:
MachineTranslationForm
Form for creating and modifying event translation objects
Form fields:
title
: Title of the event (CharField
)status
: Status (TypedChoiceField
)content
: Description (CharField
)minor_edit
: Minor edit (BooleanField
)automatic_translation
: Automatic translation (BooleanField
)machine_translated
: Machine translated (BooleanField
)slug
: Event link (SlugField
)mt_translations_to_create
: Create new translations: (ModelMultipleChoiceField
)mt_translations_to_update
: Update existing translations: (ModelMultipleChoiceField
)
- Parameters:
kwargs (Any)
- property media[source]
Return all media required to render the widgets on this form.
External Calendar Form
- class integreat_cms.cms.forms.events.external_calendar_form.ExternalCalendarForm(user: User | None, *args: Any, **kwargs: Any)[source]
Bases:
CustomModelForm
Form for adding a new external calendar
Form fields:
name
: Calendar name (CharField
)url
: URL (URLField
)import_filter_category
: The category that events need to have to get imported (Leave blank to import all events) (CharField
)
- Parameters:
user (User | None)
args (Any)
kwargs (Any)
- __init__(user: User | None, *args: Any, **kwargs: Any) None [source]
Initialize placeholder model form
- property media[source]
Return all media required to render the widgets on this form.
Recurrence Rule Form
- class integreat_cms.cms.forms.events.recurrence_rule_form.RecurrenceRuleForm(**kwargs: Any)[source]
Bases:
CustomModelForm
Form for creating and modifying event recurrence rule objects
Form fields:
frequency
: Frequency (TypedChoiceField
)interval
: Repeat every … time(s) (IntegerField
)weekdays_for_weekly
: Weekdays (SimpleArrayField
)weekday_for_monthly
: Weekday (TypedChoiceField
)week_for_monthly
: Week (TypedChoiceField
)recurrence_end_date
: Recurrence end date (DateField
)has_recurrence_end_date
: Recurrence ends (BooleanField
)
- Parameters:
kwargs (Any)
- __init__(**kwargs: Any) None [source]
Initialize recurrence rule form
- Parameters:
**kwargs (Any) – The supplied keyword arguments
- Return type:
None
- clean() dict[str, Any] [source]
Validate form fields which depend on each other, see
django.forms.Form.clean()
- has_changed() bool [source]
This function provides a workaround for the
weekdays_for_weekly
field to be correctly recognized as changed.- Returns:
Whether or not the recurrence rule form has changed
- Return type:
- property media[source]
Return all media required to render the widgets on this form.