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: django.forms.widgets.Select
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.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.SelectWidget( 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