extended_choices.fields module

Provides a form field for django to use constants instead of values as available values.


The documentation format in this file is numpydoc.

class extended_choices.fields.NamedExtendedChoiceFormField(choices, *args, **kwargs)[source]

Bases: django.forms.fields.Field

Field to use with choices where values are constant names instead of choice values.

Should not be very useful in normal HTML form, but if API validation is done via a form, it will to have more readable constants in the API that values


Convert the constant to the real choice value.