A django model and form field for normalised cpf and cnpj.
Project description
A Django library for working with cpf and cnpj fields.
Installation
Install from pypi:
pip install django-cpf-cnpj
Install from git:
pip install git+https://github.com/elyasha/django-cpf-cnpj2.git
Basic usage
Add the django_cpf_cnpj app between your apps and django apps:
INSTALLED_APPS = [ ... 'django_cpf_cnpj', ... ]
Then, you can use it like any regular model field:
from django_cpf_cnpj.fields import CPFField, CNPJField from django.db import models class MyModel(models.Model): cpf = CPFField(masked=True) # To enable auto-mask xxx.xxx.xxx-xx cnpj = CNPJField(masked=False) # To disable auto-mask xx.xxx.xxx/xxxx-xx
Running tests
Check tests with tox:
tox
Check a specific combination:
tox -e py38-django22
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-cpf-cnpj2-1.3.0.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for django_cpf_cnpj2-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b8c1679dc038000ba29df900f2a93ef8cc5166a926c9e20e929c74084673906 |
|
MD5 | 4947f4f89e3939150c619994b72f9897 |
|
BLAKE2b-256 | 52c1754e710352aab62469b2a2a8f806efe0f3a0f8ce8e5afefcd15a41fc83d9 |