Packages implementing fields used in Brazil for Dexterity and Volto projects
Project description
plonegovbr.brfields 🚀
Plone package implementing Dexterity fields for common data types used in Brazil.
Features ✨
This package provides the following Dexterity fields:
- CEP (
plonegovbr.brfields.fields.CEP): 🏠 A text field for validating and storing Brazilian postal codes (CEP) with basic format validation. - CNPJ (
plonegovbr.brfields.fields.CNPJ): 🏢 A text field for validating and storing Brazilian company registration numbers (CNPJ) with value validation. - CPF (
plonegovbr.brfields.fields.CPF): 🆔 A text field for validating and storing Brazilian individual taxpayer numbers (CPF) with value validation. - Estados (
plonegovbr.brfields.fields.Estados): 📍 A choice field with a predefined vocabulary of Brazilian states, usingplonegovbr.vocabulary.estadosfor validation. - Telefone (
plonegovbr.brfields.fields.Telefone): 📞 A text field for validating and storing Brazilian phone numbers.
Additionally, the package provides the following named vocabulary:
plonegovbr.vocabulary.estados: 📌 A predefined list of Brazilian states.
Installation 🛠️
To install plonegovbr.brfields, add it to your project dependencies and install the package using your preferred method.
Using setup.py 🐍
For projects managed via setup.py, edit your setup.py file and add plonegovbr.brfields to the install_requires list:
install_requires = [
...
"plonegovbr.brfields",
]
Then, install the dependencies:
pip install -e .
Using pyproject.toml 📜
For projects using pyproject.toml, add plonegovbr.brfields to the dependencies list under the [project] section:
dependencies = [
...
"plonegovbr.brfields",
]
Then, install the dependencies:
pip install .
Usage 📖
To use one of these fields in your content type, import the required field and include it in your schema definition.
Example:
from plonegovbr.brfields.fields import CPF
from zope.interface import Interface
from plone.supermodel import model
class IDemoContent(model.Schema):
"""Demo content showcasing all available fields."""
cpf = CPF(
title=_("CPF"),
description=_("Enter the CPF number"),
required=True,
)
Volto Support ⚡
For Volto support, you need to add the package @plonegovbr/volto-brwidgets to your Volto project. This package provides widgets to properly render the Brazilian-specific fields in the Volto UI.
Contributing 🤝
Contributions are welcome! If you find any issues or want to suggest improvements, please check out:
License 📜
This project is licensed under the GPLv2.
Credits & Acknowledgements 🙏
This package was developed and maintained by the PloneGov-BR community ❤️.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plonegovbr.brfields-1.0.0a2.tar.gz.
File metadata
- Download URL: plonegovbr.brfields-1.0.0a2.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4a3b7d67fa608c41e08a1c8cf138bd34cb5abcb7c24eba4b7d9543d0d11ca40
|
|
| MD5 |
299199090ae5b76c252b5150c28457b9
|
|
| BLAKE2b-256 |
4a696979a5843e13fb7fbae3a4e4756f94cf86e162fbed118f01e6826420cc72
|
File details
Details for the file plonegovbr.brfields-1.0.0a2-py3-none-any.whl.
File metadata
- Download URL: plonegovbr.brfields-1.0.0a2-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac477727e7e77abe0ea45e59ee976b5b3849a1e8f8bd9d8b4c229b434337a470
|
|
| MD5 |
888eef8e53b0803a14cadad648fb44a4
|
|
| BLAKE2b-256 |
bf1414ccf582445aa11b775ddddf31847488a461fdd933aac9cdd389ec298e7f
|