Django rest framework validation enhancement
Project description
Validator
#########
Validator is a library that provides an improved handling of validation.
The following parts of validation are handled;
- state
- transistion
Installation
============
.. code-block:: bash
pip install etools-validator
Setup
=====
Add ``validator`` to ``INSTALLED_APPS`` in ``settings.py``
.. code-block:: python
INSTALLED_APPS = [
...
'validator',
]
Usage
=====
Use ``validator`` in views
.. code-block:: python
from validator.mixins import ValidatorViewMixin
class ExampleView(ValidatorViewMixin, ListCreateAPIView):
...
Contributing
============
Environment Setup
-----------------
To install the necessary libraries
::
$ pip install -r requirements/dev.txt
Coding Standards
----------------
See `PEP 8 Style Guide for Python Code <https://www.python.org/dev/peps/pep-0008/>`_ for complete details on the coding standards.
To run checks on the code to ensure code is in compliance
::
$ flake8 .
Testing
-------
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
#########
Validator is a library that provides an improved handling of validation.
The following parts of validation are handled;
- state
- transistion
Installation
============
.. code-block:: bash
pip install etools-validator
Setup
=====
Add ``validator`` to ``INSTALLED_APPS`` in ``settings.py``
.. code-block:: python
INSTALLED_APPS = [
...
'validator',
]
Usage
=====
Use ``validator`` in views
.. code-block:: python
from validator.mixins import ValidatorViewMixin
class ExampleView(ValidatorViewMixin, ListCreateAPIView):
...
Contributing
============
Environment Setup
-----------------
To install the necessary libraries
::
$ pip install -r requirements/dev.txt
Coding Standards
----------------
See `PEP 8 Style Guide for Python Code <https://www.python.org/dev/peps/pep-0008/>`_ for complete details on the coding standards.
To run checks on the code to ensure code is in compliance
::
$ flake8 .
Testing
-------
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file etools-validator-0.2.0.tar.gz
.
File metadata
- Download URL: etools-validator-0.2.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bdc3427827c3d58ff3ae33f17d184711f3fbacc60c1e1397daf1f357ed75d2e |
|
MD5 | 6a88e5256418663f2db3ea45a0861d7d |
|
BLAKE2b-256 | b923c575648c7c52b2ecbbc5b39ef399b4e252463cf2ba1ade8190f6076c3d0b |