From affad8eff67d2a65817d6fbae4195e51fd4d46d5 Mon Sep 17 00:00:00 2001 From: Francesco Frassinelli Date: Tue, 30 Oct 2018 10:39:57 +0100 Subject: [PATCH] Add get_validators example --- doc/extensions/adding-custom-fields.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/extensions/adding-custom-fields.rst b/doc/extensions/adding-custom-fields.rst index 8e1673dbd55..dcec01e8051 100644 --- a/doc/extensions/adding-custom-fields.rst +++ b/doc/extensions/adding-custom-fields.rst @@ -302,6 +302,11 @@ special schema fields ``'__before'`` or ``'__after'`` to have them run before or after all the other validation takes place to avoid the problem of working with partially-validated data. +The validator has to be registered. Example: + +.. literalinclude:: ../../ckanext/example_ivalidators/plugin.py + :start-after: from ckan.plugins.toolkit import Invalid + :end-before: def equals_fortytwo(value): Tag vocabularies ----------------