diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-10-12 11:50:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-12 11:50:13 +0200 |
| commit | 004f985b918d5ea36fbed9b050459dd22edaf396 (patch) | |
| tree | 84854baa9aa54e92591fb55aec642acc05556a05 /docs | |
| parent | c4aac2ac1e469f0dc27b4dce230c7b29add617ba (diff) | |
Refs #34059 -- Doc'd lack of support for validation of constraints with JSONFields.
Thanks Dan LaManna for the report.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/constraints.txt | 11 | ||||
| -rw-r--r-- | docs/ref/models/instances.txt | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt index 8134a657d8..c8a3eac013 100644 --- a/docs/ref/models/constraints.txt +++ b/docs/ref/models/constraints.txt @@ -34,6 +34,17 @@ option. Constraints are checked during the :ref:`model validation <validating-objects>`. +.. admonition:: Validation of Constraints with ``JSONField`` + + Constraints containing :class:`~django.db.models.JSONField` may not raise + validation errors as key, index, and path transforms have many + database-specific caveats. This :ticket:`may be fully supported later + <34059>`. + + You should always check that there are no log messages, in the + ``django.db.models`` logger, like *"Got a database error calling check() on + …"* to confirm it's validated properly. + .. versionchanged:: 4.1 In older versions, constraints were not checked during model validation. diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 62c680833a..f0306a7460 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -211,6 +211,17 @@ need to call a model's :meth:`~Model.full_clean()` method if you plan to handle validation errors yourself, or if you have excluded fields from the :class:`~django.forms.ModelForm` that require validation. +.. warning:: + + Constraints containing :class:`~django.db.models.JSONField` may not raise + validation errors as key, index, and path transforms have many + database-specific caveats. This :ticket:`may be fully supported later + <34059>`. + + You should always check that there are no log messages, in the + ``django.db.models`` logger, like *"Got a database error calling check() on + …"* to confirm it's validated properly. + .. versionchanged:: 4.1 In older versions, constraints were not checked during the model |
