Skip to main content

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, using plonegovbr.vocabulary.estados for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plonegovbr.brfields-1.0.0a0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plonegovbr.brfields-1.0.0a0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file plonegovbr.brfields-1.0.0a0.tar.gz.

File metadata

  • Download URL: plonegovbr.brfields-1.0.0a0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for plonegovbr.brfields-1.0.0a0.tar.gz
Algorithm Hash digest
SHA256 dfd9db9e1055fdc571b8ddcef78c0a2ac8b4eba71630dfcd0fc0897cc33bb58d
MD5 e8bb0070ef914f2f997d8a1fb1147f77
BLAKE2b-256 921db18a884995895408cff9c61b6cdd9c9f79bea21bff41e62714d2fa281025

See more details on using hashes here.

File details

Details for the file plonegovbr.brfields-1.0.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for plonegovbr.brfields-1.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5af89a06eef2074c54884af9791a8b40d62ead54688818cc793f79788168598
MD5 ca132c90d65651cdef23aa870293107b
BLAKE2b-256 cf3fa959f2c525f287769be486f068613bfbc548d66ec93ea6a49052c5b0b5b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page