django / django-localflavor

Country-specific Django helpers, formerly of contrib fame
https://django-localflavor.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
828 stars 290 forks source link

Model fields to brazillian documents #334

Closed andrelramos closed 5 years ago

andrelramos commented 6 years ago

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:

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 commented 6 years ago

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 commented 6 years ago

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

benkonrath commented 5 years ago

Fixed in 9d47350d9e4f76d3a24e66750281ad8a380da76e.