Form Fields¶
fields
¶
ChoiceFieldNoValidation
¶
Bases: ChoiceField
ChoiceField that skips server-side choice validation.
Use when choices are populated dynamically via JavaScript on the client side, so the submitted value may not be in the server-defined choices list.
CheckboxMultipleChoiceField(*args, **kwargs)
¶
Bases: MultipleChoiceField
MultipleChoiceField that renders as checkboxes and handles JSON serialization.
Used as the default form field for MultipleChoiceField (model field).
Accepts and produces Python lists; handles JSON string input from the
database transparently.
USAddressFormField(*args, **kwargs)
¶
Bases: Field
Form field for US addresses with multi-component input and validation.
Renders as five separate inputs (street, street line 2, city, state dropdown,
ZIP code) via USAddressWidget. Produces a dict with keys
street_address, street_address_2, city, state, zip_code.
Validates that required address components are present, state is a 2-letter
code, and ZIP matches XXXXX or XXXXX-XXXX format.
This is the default form field for USAddressField (model field) and
is normally not used directly.
CurrencyFormField(*args, **kwargs)
¶
Bases: DecimalField
DecimalField for currency input with client-side formatting.
Defaults to max_digits=10 and decimal_places=2. Uses
CurrencyInput widget which adds $ sign and comma separators via
JavaScript on blur.
This is the default form field for CurrencyField (model field).