diff --git a/dev/concepts/advanced/typing_and_validation/index.html b/dev/concepts/advanced/typing_and_validation/index.html index 2a75a828..7e55853a 100644 --- a/dev/concepts/advanced/typing_and_validation/index.html +++ b/dev/concepts/advanced/typing_and_validation/index.html @@ -108,9 +108,9 @@
Warning
Input validation was part of Django Components from version 0.96 to 0.135.
Since v0.136, input validation is available as a separate extension.
To enable input validation, you need to install the djc-ext-pydantic
extension:
And add the extension to your project:
COMPONENTS = {
"extensions": [
- "djc_ext_pydantic.PydanticExtension",
+ "djc_pydantic.PydanticExtension",
],
}
djc-ext-pydantic
integrates Pydantic for input and data validation. It uses the types defined on the component's class to validate inputs of Django components.
On Python 3.8-3.10, use typing_extensions
Additionally on Python 3.8-3.9, also import annotations
:
Moreover, on 3.10 and less, you may not be able to use NotRequired
, and instead you will need to mark either all keys are required, or all keys as optional, using TypeDict's total
kwarg.
See PEP-655 for more info.