JSONField
class JSONField
A JSON field for forms.
JSONField(
*,
required: bool = True,
default: dict | str | None = None,
label: str | None = None,
messages: dict[str, str] | None = None
)Bases: Field
| Argument | Description |
|---|---|
required |
Whether the field is required. Defaults to True. |
default |
Default value for the field. Can be a static value or a callable. Defaults to None. |
label |
Text of the field's label, stored as label_text. Used by thelabel() render method when it is called without a text.Defaults to None. |
messages |
Dictionary of error codes to custom error message templates. These override the default error messages for this specific field. Example: . |
This field is used to capture unstructured JSON input from users.
Use a FormField instead if the structure of the JSON is known and
can be represented as a form.