Skip to content

Commit

Permalink
Add get_validators example
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Oct 30, 2018
1 parent e04a753 commit affad8e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/extensions/adding-custom-fields.rst
Expand Up @@ -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
----------------
Expand Down

0 comments on commit affad8e

Please sign in to comment.