Contacts
Forms for creating and modifying contact objects
Contact Form
- class integreat_cms.cms.forms.contacts.contact_form.ContactForm(**kwargs: Any)[source]
Bases:
CustomModelFormForm for creating and modifying contact objects
Form fields:
area_of_responsibility: Area of responsibility (CharField)name: Name (CharField)location: Location (ModelChoiceField)email: Email address (EmailField)phone_number: Phone number (CharField)mobile_phone_number: Mobile phone number (CharField)website: Website (URLField)opening_hours: Opening hours (JSONField)appointment_url: Appointment link (URLField)use_location_opening_hours: Adopt opening hours from linked location (BooleanField)
- Parameters:
kwargs (Any)
- __init__(**kwargs: Any) None[source]
Initialize placeholder model form
- Parameters:
**kwargs (Any) – The supplied keyword arguments
- Raises:
TypeError – If form is instantiated directly without an inheriting subclass
- Return type:
None
- clean() dict[str, Any][source]
Validate the selected location, see
django.forms.Form.clean()
- clean_mobile_phone_number() str[source]
Validate the mobile phone number field (see Overriding the clean() method). The number will be converted to the international format, i.e. +XX (X) XXXXXXXX.
- Returns:
The reformatted phone number
- Return type:
- clean_phone_number() str[source]
Validate the phone number field (see Overriding the clean() method). The number will be converted to the international format, i.e. +XX (X) XXXXXXXX.
- Returns:
The reformatted phone number
- Return type:
- property media[source]
Return all media required to render the widgets on this form.
Contact Search Form
- class integreat_cms.cms.forms.contacts.contact_search_form.ContactSearchForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]
Bases:
ObjectSearchFormForm fields:
query: Query (CharField)
- property media[source]
Return all media required to render the widgets on this form.