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

Uploaded Python 3

File details

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

File metadata

  • Download URL: plonegovbr.brfields-1.0.0a3.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.0a3.tar.gz
Algorithm Hash digest
SHA256 a096b32b2182b978076f2502caf8f386bc8a7ab643dadf23ad7d645f25854006
MD5 22379b8e2503e8401e968b6a3f54fc60
BLAKE2b-256 9f7d1f4124bc479c287a7a47000e005ad73d4579dbd467ce122a50e29aefa537

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plonegovbr.brfields-1.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 4522725fa9a13c127e0fbbb84ba7d2742e216d2633ea1c209072ad4379f9252b
MD5 94f0f16acde03e234d84ae58fcbfed3f
BLAKE2b-256 d63c97c280c1e13718d99645ac7746cec6db526920a61c646266ae1f37096218

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