Validator is a library that provides an improved handling of validation.
The following parts of validation are handled;
- state
- transistion
pip install etools-validator
Add validator
to INSTALLED_APPS
in settings.py
.. code-block:: python
- INSTALLED_APPS = (
... 'etools_validator',
)
Use validator
in views
from validator.mixins import ValidatorViewMixin
class ExampleView(ValidatorViewMixin, ListCreateAPIView):
...
To install the necessary libraries
$ pip install -r requirements/dev.txt
See PEP 8 Style Guide for Python Code for complete details on the coding standards.
To run checks on the code to ensure code is in compliance
$ flake8 .
Testing is important and tests are located in tests/ directory and can be run with;
$ coverage run manage.py test
Coverage report is viewable in build/coverage directory, and can be generated with;
$ coverage html
Stable | |||
Development | |||
Source Code | https://github.co | m/unicef/etools | -validator |
Issue tracker | https://github.co | m/unicef/etools | -validator/issues |