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.0a1.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.0a1-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plonegovbr.brfields-1.0.0a1.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.0a1.tar.gz
Algorithm Hash digest
SHA256 d572302f4d60c7d799b785da0a98b443f298524965845c672c1434d1b9a3e626
MD5 d5c8de2087e16700b07eecfd9eb1229f
BLAKE2b-256 5abedefa20b5cff0c4d98b8d349279cd61ccfd4c63d51d157be84c9bd10cc4a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plonegovbr.brfields-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f59b9a6ac9b6897966ecac30eb602984ed9cb9a7f2141185ad960bd395c26de
MD5 d0c4ff1975eb88d9fafff792d24661db
BLAKE2b-256 266e5acb6e770fbe03688f12e33fb873cdb06bca924d22f5597ac8cdbd14e6fc

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