Skip to content

Added a utils.py get_states_of_brazil #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vic012
Copy link

@vic012 vic012 commented Jul 29, 2024

All Changes
I Added a utils.py file to localflavor.br initially with a method called get_states_of_brazil. Through this method, the user can get the state through a (federative_unit - str) and can configure the return to be upper or lower case. If the federative_unit is None or if its value is not in the available state options, a dict will be returned with all states of Brazil.

  • [x ] Add an entry to the docs/changelog.rst describing the change.

  • [x ] Add an entry for your name in the docs/authors.rst file if it's not
    already there.

Copy link

@leogregianin leogregianin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful for many applications

@benkonrath
Copy link
Member

@vic012 Can you provide some information about how this fits into django-localflavor? Reading through get_states_of_brazil(), it seems to be a helper function / application specific logic, rather than something connected to a Django model or form. I don't use the Brazil locolflavor personally, so I don't know how it's useful to developers in Brazil who use the BR flavor. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants