cdh.core.forms module

class cdh.core.forms.BootstrapCheckboxInput(attrs=None, check_test=None)[source]

Bases: CheckboxInput

Override of Django’s version to use the right Bootstrap classes

property media
template_name = 'cdh.core/forms/widgets/bootstrap_checkbox.html'
class cdh.core.forms.BootstrapCheckboxSelectMultiple(attrs=None, choices=())[source]

Bases: CheckboxSelectMultiple

Override of Django’s version to use the right Bootstrap classes

property media
option_template_name = 'cdh.core/forms/widgets/bootstrap_radio_option.html'
template_name = 'cdh.core/forms/widgets/bootstrap_radio.html'
class cdh.core.forms.BootstrapRadioSelect(attrs=None, choices=())[source]

Bases: RadioSelect

Override of Django’s version to use the right Bootstrap classes

property media
option_template_name = 'cdh.core/forms/widgets/bootstrap_radio_option.html'
template_name = 'cdh.core/forms/widgets/bootstrap_radio.html'
class cdh.core.forms.BootstrapSelect(attrs=None, choices=())[source]

Bases: Select

Override of Django’s version to use the right Bootstrap classes

get_context(*args, **kwargs)[source]
property media
class cdh.core.forms.ColorField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

Bases: CharField

Override of Django’s version to use the right HTML5 input

widget

alias of ColorInput

class cdh.core.forms.ColorInput(attrs=None)[source]

Bases: TextInput

Override of Django’s version to use the right HTML5 input

input_type = 'color'
property media
class cdh.core.forms.DateField(*, input_formats=None, **kwargs)[source]

Bases: DateField

Override of Django’s version to use the right HTML5 input

widget

alias of DateInput

class cdh.core.forms.DateInput(attrs=None, format=None)[source]

Bases: DateInput

Override of Django’s version to use the right HTML5 input

input_type = 'date'
property media
class cdh.core.forms.DateTimeField(*, input_formats=None, **kwargs)[source]

Bases: DateTimeField

Override of Django’s version to use the right HTML5 input

widget

alias of DateTimeInput

class cdh.core.forms.DateTimeInput(attrs=None, format=None)[source]

Bases: DateTimeInput

Override of Django’s version to use the right HTML5 input

input_type = 'datetime-local'
property media
class cdh.core.forms.PasswordField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

Bases: CharField

Override of Django’s version to use the right HTML5 input

widget

alias of PasswordInput

class cdh.core.forms.SplitDateTimeField(*, input_date_formats=None, input_time_formats=None, **kwargs)[source]

Bases: SplitDateTimeField

Override of Django SplitDateTimeField to use HTML5 fields

widget

alias of SplitDateTimeWidget

class cdh.core.forms.SplitDateTimeWidget(attrs=None, date_format=None, time_format=None, date_attrs=None, time_attrs=None)[source]

Bases: SplitDateTimeWidget

Override of Django SplitDateTimeWidget to use HTML5 fields

__init__(attrs=None, date_format=None, time_format=None, date_attrs=None, time_attrs=None)[source]
property media

Media for a multiwidget is the combination of all media of the subwidgets.

class cdh.core.forms.TelephoneField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

Bases: CharField

Override of Django’s version to use the right HTML5 input

widget

alias of TelephoneInput

class cdh.core.forms.TelephoneInput(attrs=None)[source]

Bases: TextInput

Override of Django’s version to use the right HTML5 input

input_type = 'tel'
property media
class cdh.core.forms.TemplatedForm(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: TemplatedFormMixin, Form

Extension of the default Form to enable the UU-Form styling

Uses TemplatedFormMixin

Form fields:

property media

Return all media required to render the widgets on this form.

class cdh.core.forms.TemplatedFormMixin[source]

Bases: object

Mixin for Django Form to enable the UU-Form styling

Parameters
  • form_template (str) – the form_template to use

  • show_help_column (bool) – if False, the help column will be removed on every field

  • always_show_help_column (bool) – if False, the help column will be removed on fields that don’t have help texts

always_show_help_column = True
get_context()[source]
show_help_column = True
show_valid_fields = True
template_name = 'cdh.core/form_template.html'
class cdh.core.forms.TemplatedModelForm(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, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: TemplatedFormMixin, ModelForm

Extension of the default Form to enable the UU-Form styling

Uses TemplatedFormMixin

Form fields:

property media

Return all media required to render the widgets on this form.

class cdh.core.forms.TimeField(*, input_formats=None, **kwargs)[source]

Bases: TimeField

Override of Django’s version to use the right HTML5 input

widget

alias of TimeInput

class cdh.core.forms.TimeInput(attrs=None, format=None)[source]

Bases: TimeInput

Override of Django’s version to use the right HTML5 input

input_type = 'time'
property media
class cdh.core.forms.TinyMCEWidget(menubar: bool = False, plugins: Optional[List[str]] = None, toolbar: Optional[str] = 'undo redo casechange blocks bold italic underline link bullist numlist | code', *args, **kwargs)[source]

Bases: Widget

A TinyMCE widget for HTML editting

__init__(menubar: bool = False, plugins: Optional[List[str]] = None, toolbar: Optional[str] = 'undo redo casechange blocks bold italic underline link bullist numlist | code', *args, **kwargs)[source]

All parameters should have sensible defaults.

Parameters
  • menubar (bool) – if the TinyMCE menubar needs to be shown. Probably not

  • plugins (str) – a list of TinyMCE plugins to load

  • plugins – a TinyMCE toolbar definition

get_context(*args, **kwargs)[source]
property media
template_name = 'cdh.core/forms/widgets/tinymce.html'