Skip to content
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

Model fields to brazillian documents #334

Closed
andrelramos opened this issue Apr 26, 2018 · 3 comments
Closed

Model fields to brazillian documents #334

andrelramos opened this issue Apr 26, 2018 · 3 comments

Comments

@andrelramos
Copy link
Contributor

andrelramos commented Apr 26, 2018

I'm working on a system that needs some specific brazilian fields. Some of them already has in br form fields but a have many model forms that needs this fields and it would be nice if they were created as model fields.

The fields are:

  • Brazilian documents (CPF and CNPJ)
  • Brazilian Telephone and Cell Phone format
  • Brazilian Zip Code

In 2015 i was started a PR with code to solve it (#188) but it was denied, so i'm creating this issue to check the idea.

@benkonrath
Copy link
Member

It's fine by me. I don't know what the PR was turned down last time. I'll review this PR when you make it.

It's best to extract the validation into a separate validator and use this validator for the form and the model. You can look at some the example models already included in localflavor to see how it's done (e.g. the IBAN fields).

If you're not sure about something, just make a 'work in progress' PR and we can discuss things on the PR. Thanks!

andrelramos added a commit to andrelramos/django-localflavor that referenced this issue Jul 29, 2018
@andrelramos
Copy link
Contributor Author

@benkonrath it's done! can you take a look in PR #341?

@benkonrath
Copy link
Member

Fixed in 9d47350.

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

No branches or pull requests

2 participants