mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[4.1.x] Refs #34059 -- Doc'd lack of support for validation of constraints with JSONFields.
Thanks Dan LaManna for the report.
Backport of 004f985b91 from main
			
			
This commit is contained in:
		| @@ -34,6 +34,17 @@ option. | |||||||
|     Constraints are checked during the :ref:`model validation |     Constraints are checked during the :ref:`model validation | ||||||
|     <validating-objects>`. |     <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 | .. versionchanged:: 4.1 | ||||||
|  |  | ||||||
|     In older versions, constraints were not checked during model validation. |     In older versions, constraints were not checked during model validation. | ||||||
|   | |||||||
| @@ -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 | validation errors yourself, or if you have excluded fields from the | ||||||
| :class:`~django.forms.ModelForm` that require validation. | :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 | .. versionchanged:: 4.1 | ||||||
|  |  | ||||||
|     In older versions, constraints were not checked during the model |     In older versions, constraints were not checked during the model | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user