https://github.com/jrsouza95/drf-cpfcnpj-validator
A small and quick validation plugin for CPF and CNPJ in django rest framework!
https://github.com/jrsouza95/drf-cpfcnpj-validator
cnpj cpf django django-rest-framework drf drf-cnpj-validation drf-cpf-validation drf-validation library plugin python validacao-de-cnpj validacao-de-cpf validation validation-library validation-plugin validator validators
Last synced: 5 months ago
JSON representation
A small and quick validation plugin for CPF and CNPJ in django rest framework!
- Host: GitHub
- URL: https://github.com/jrsouza95/drf-cpfcnpj-validator
- Owner: jrsouza95
- License: mit
- Archived: true
- Created: 2017-08-15T15:31:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-17T17:09:24.000Z (almost 9 years ago)
- Last Synced: 2025-09-22T14:35:20.217Z (9 months ago)
- Topics: cnpj, cpf, django, django-rest-framework, drf, drf-cnpj-validation, drf-cpf-validation, drf-validation, library, plugin, python, validacao-de-cnpj, validacao-de-cpf, validation, validation-library, validation-plugin, validator, validators
- Language: Python
- Size: 21.5 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DJANGO REST CNPJ OR CPF VALIDATOR
> A small and quick validation plugin for CPF or CNPJ in django rest framework!
#### Install:
``` shell
sudo pip install drf_cpf_cnpj_validator
```
#### Examples:
``` python
from rest_framework import serializers
from drf_cpf_cnpj_validator.validadors import cpf_validator, cnpj_validator
class PersonSerializer(serializers.ModelSerializer):
cpf = serializers.Charfield(validators=[cpf_validator])
class CompanySerializer(serializers.ModelSerializer):
cnpj = serializers.Charfield(validators=[cnpj_validator])
```
#### Translations:
This plugin translate the messages from your **_LANGUAGE_CODE_** , located in settings.py.
* **Enabled translations:**
- en-US
- pt-BR
- es-ES