Brazil specific Django helpers
Project description
Funcionalidades para informações e dados do Brasil.
Por exemplo, pode incluir no forms ou nos models campos de códigos postais (CEP), números de CPF, número de CNPJ e número de processo judicial para validação automática.
Também pode incluir campos de seleção de estados, cidades com código IBGE, países com código IBGE e bancos registrados no Brasil.
Este pacote é inspirado no django-localflavor com melhorias e adição de novas informações específicas para o Brasil.
Requisitos
Python >= 3.8
Django >= 4.2
Veja todos os testes rodando em todas as versões Python e Django: https://github.com/leogregianin/django-br-utils/actions
Instalação
pip install django-br-utils
Adicione br_utils em INSTALLED_APPS no settings.py:
INSTALLED_APPS = (
...,
'br_utils',
...,
)
Como utilizar nos models
from django.db import models
from django_br_utils.models import (
BRCPFField,
BRCNPJField,
BRPostalCodeField,
BRStateField,
BRCityField
CountryField,
BRBankField,
)
class Cadastro(models.Model):
nome = models.CharField(max_length=100)
email = models.EmailField()
cpf = BRCPFField()
cnpj = BRCNPJField()
cep = BRPostalCodeField()
uf = BRStateField()
cidade = BRCityField()
pais = CountryField()
banco = BRBankField()
Como utilizar nos forms
from django import forms
from django_br_utils.forms import (
BRCPFField,
BRCNPJField,
BRPostalCodeField,
BRStateChoiceField,
BRCityChoiceField
CountryChoiceField,
BRBankChoiceField,
)
class CadastroForm(forms.Form):
nome = forms.CharField(max_length=100)
email = forms.EmailField()
cpf = BRCPFField()
cnpj = BRCNPJField()
cep = BRPostalCodeField()
uf = BRStateChoiceField()
cidade = BRCityChoiceField()
pais = CountryChoiceField()
banco = BRBankChoiceField()
Contribuição
Contribuições são sempre bem vindas.
Sinta-se a vontade para abrir uma Issue para correções, dúvidas ou sugestões.
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
Built Distribution
File details
Details for the file django_br_utils-0.2.tar.gz
.
File metadata
- Download URL: django_br_utils-0.2.tar.gz
- Upload date:
- Size: 74.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d82b2e0d3af8363ab972efd80f41ef5915c7b43d6b51f5ab67f071976e8913f |
|
MD5 | b3a40bcc57e1ca89de78aefaf7b447dd |
|
BLAKE2b-256 | 6776adb20e1440c58c34f1ff4fab2cba2e2b54b85f38acbd446cc85c27329c24 |
Provenance
The following attestation bundles were made for django_br_utils-0.2.tar.gz
:
Publisher:
release.yml
on leogregianin/django-br-utils
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_br_utils-0.2.tar.gz
- Subject digest:
1d82b2e0d3af8363ab972efd80f41ef5915c7b43d6b51f5ab67f071976e8913f
- Sigstore transparency entry: 164823316
- Sigstore integration time:
- Permalink:
leogregianin/django-br-utils@c3ef2e8053ba9d58daa72b2c5486750025bc0870
- Branch / Tag:
refs/tags/0.2
- Owner: https://github.com/leogregianin
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yml@c3ef2e8053ba9d58daa72b2c5486750025bc0870
- Trigger Event:
push
- Statement type:
File details
Details for the file django_br_utils-0.2-py3-none-any.whl
.
File metadata
- Download URL: django_br_utils-0.2-py3-none-any.whl
- Upload date:
- Size: 68.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2abc6a43b8429c46fdf5ff36436dd0178bcc411fd2dbbc4bc644e60991c286ff |
|
MD5 | 3944aa2e49301a934a1f66e94a0ec57f |
|
BLAKE2b-256 | b3a2e2dccbe1d24f6dc777dbef5d7bf83f6713b9f286f9302f91a5f612ad9963 |
Provenance
The following attestation bundles were made for django_br_utils-0.2-py3-none-any.whl
:
Publisher:
release.yml
on leogregianin/django-br-utils
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_br_utils-0.2-py3-none-any.whl
- Subject digest:
2abc6a43b8429c46fdf5ff36436dd0178bcc411fd2dbbc4bc644e60991c286ff
- Sigstore transparency entry: 164823327
- Sigstore integration time:
- Permalink:
leogregianin/django-br-utils@c3ef2e8053ba9d58daa72b2c5486750025bc0870
- Branch / Tag:
refs/tags/0.2
- Owner: https://github.com/leogregianin
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yml@c3ef2e8053ba9d58daa72b2c5486750025bc0870
- Trigger Event:
push
- Statement type: