Bases: django.forms.fields.ChoiceField
A subclass of ChoiceField with additional properties that make dynamically updating its elements easier.
Notably, the field declaration takes an extra argument, add_item_link which may be a string or callable defining the URL that should be used for the “add” link associated with the field.
alias of DynamicSelectWidget
Bases: horizon.forms.fields.SelectWidget
A subclass of the Select widget which renders extra attributes for use in callbacks to handle dynamic changes to the available choices.
Bases: horizon.forms.fields.DynamicChoiceField, django.forms.fields.TypedChoiceField
Simple mix of DynamicChoiceField and TypedChoiceField.
Bases: django.forms.fields.FileField
A special flavor of FileField which is meant to be used in cases when instead of uploading file to Django it should be uploaded to some external location, while the form validation is done as usual. Should be paired with ExternalUploadMeta metaclass embedded into the Form class.
Bases: django.forms.forms.DeclarativeFieldsMetaclass
Set this class as the metaclass of a form that contains ExternalFileField in order to process ExternalFileField fields in a specific way. A hidden CharField twin of FieldField is created which contains just the filename (if any file was selected on browser side) and a special clean method for FileField is defined which extracts just file name. This allows to avoid actual file upload to Django server, yet process form clean() phase as usual. Actual file upload happens entirely on client-side.
Bases: django.forms.fields.Field
Form field for entering IP/range values, with validation. Supports IPv4/IPv6 in the format: .. xxx.xxx.xxx.xxx .. xxx.xxx.xxx.xxx/zz .. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff .. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/zz and all compressed forms. Also the short forms are supported: xxx/yy xxx.xxx/yy
Specifies which IP version to validate, valid values are 1 (fields.IPv4), 2 (fields.IPv6) or both - 3 (fields.IPv4 | fields.IPv6). Defaults to IPv4 (1)
Boolean flag to validate subnet masks along with IP address. E.g: 10.0.0.1/32
Bases: horizon.forms.fields.IPField
Extends IPField to allow comma-separated lists of addresses.
Bases: django.forms.widgets.Select
Customizable select widget, that allows to render data-xxx attributes from choices. This widget also allows user to specify additional html attributes for choices.
Specifies object properties to serialize as data-xxx attribute. If passed (‘id’, ), this will be rendered as: <option data-id=”123”>option_value</option> where 123 is the value of choice_value.id
A callable used to render the display value from the option object.
A callable used to render additional HTML attributes for the option object. It returns a dictionary containing the html attributes and their values. For example, to define a title attribute for the choices:
helpText = { 'Apple': 'This is a fruit',
'Carrot': 'This is a vegetable' }
def get_title(data):
text = helpText.get(data, None)
if text:
return {'title': text}
else:
return {}
....
....
widget=forms.ThemableSelect( attrs={'class': 'switchable',
'data-slug': 'source'},
transform_html_attrs=get_title )
self.fields[<field name>].choices =
([
('apple','Apple'),
('carrot','Carrot')
])
Bases: django.forms.widgets.CheckboxChoiceInput
Bases: django.forms.widgets.CheckboxFieldRenderer
alias of ThemableCheckboxChoiceInput
Bases: django.forms.widgets.CheckboxInput
A subclass of the Checkbox widget which renders extra markup to allow a custom checkbox experience.
Bases: django.forms.widgets.CheckboxSelectMultiple
alias of ThemableCheckboxFieldRenderer
Bases: django.forms.fields.ChoiceField
Bootstrap based select field.
alias of ThemableSelectWidget
Bases: horizon.forms.fields.DynamicChoiceField
alias of ThemableDynamicSelectWidget
Bases: horizon.forms.fields.ThemableSelectWidget, horizon.forms.fields.DynamicSelectWidget
Bases: horizon.forms.fields.ThemableDynamicChoiceField, django.forms.fields.TypedChoiceField
Simple mix of ThemableDynamicChoiceField & TypedChoiceField.
Bases: horizon.forms.fields.SelectWidget
Bootstrap base select field widget.