check for invalid validators (#140)

* check for invalid validators

* documentation and history
This commit is contained in:
Samuel Colvin
2018-03-25 16:41:48 +01:00
committed by GitHub
parent 76db984cc1
commit a8096959e2
7 changed files with 64 additions and 18 deletions
+14 -1
View File
@@ -160,7 +160,20 @@ to set a dynamic default value.
(This script is complete, it should run "as is")
You'll often want to use this together with ``pre`` since otherwise the with ``always=True``
_pydantic_ would try to validate the default ``None`` which would cause an error.
*pydantic* would try to validate the default ``None`` which would cause an error.
Field Checks
~~~~~~~~~~~~
.. note::
New in version ``v0.8.0``.
On class creation validators are checked to confirm that the fields they specify actually exist on the model.
Occasionally however this is not wanted: when you define a validator to validate fields on inheriting models.
In this case you should set ``check_fields=False`` on the validator.
Recursive Models