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.

DynamicChoiceField.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.

DynamicSelectWidget.get_add_item_url()[source]
DynamicSelectWidget.media
DynamicSelectWidget.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.

Previous topic

The horizon.forms.base Module

Next topic

The horizon.management Module

This Page