The horizon.forms.fields ModuleΒΆ
- class horizon.forms.fields.DynamicChoiceField(add_item_link=None, add_item_link_args=None, *args, **kwargs)[source]
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.
- widget
alias of DynamicSelectWidget
- class horizon.forms.fields.DynamicSelectWidget(attrs=None, choices=())[source]
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.
- get_add_item_url()[source]
- media
- render(*args, **kwargs)[source]
- class horizon.forms.fields.DynamicTypedChoiceField(add_item_link=None, add_item_link_args=None, *args, **kwargs)[source]
Bases: horizon.forms.fields.DynamicChoiceField, django.forms.fields.TypedChoiceField
Simple mix of DynamicChoiceField and TypedChoiceField.