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/flavianogjc/django-cpf-cnpj.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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for django_cpf_cnpj-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e3400b8181d9f4dd99ebd5d3c2d127d1180cb9a4e5448145f6904629c61ad12 |
|
MD5 | 768bca25eec8eb61802fed05155ccac6 |
|
BLAKE2b-256 | e1b787684f5bddea216868e834034746cdd7d7bc3c65c86044a9ebb0943fe0a2 |