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

Proposal: Interface for using country submodules generically #59

Open
paltman opened this issue Nov 19, 2013 · 3 comments
Open

Proposal: Interface for using country submodules generically #59

paltman opened this issue Nov 19, 2013 · 3 comments

Comments

@paltman
Copy link
Sponsor

paltman commented Nov 19, 2013

The use case is having a country selector and then based upon the country that is selected displaying a select input field for the regions for that country. I am doing this for a client currently so this gist is hardcoded a bit for their needs (not options expansion for the field, etc.) but wouldn't take much to make this more generally usable.

I recognize that it would be hard to make this pattern cover ALL uses the different locale specific constants/objects, but if this approach I am taking would be generally useful for inclusion in this package, i would be happy to work on something for a proper PR.

https://gist.github.com/paltman/7551838

Any feedback/thoughts?

@jezdez
Copy link
Contributor

jezdez commented Jan 17, 2014

Interesting, I think that would be useful for cases in which a site has a target audience of a couple of countries, such as US/Canada or Germany/Austria/Switzerland etc. Did you end up using something like the gist in your client project?

@vdboor
Copy link
Contributor

vdboor commented Feb 27, 2014

I'm curious, would it be possible to pick some inspiration from https://github.com/mthornhill/django-postal too? For international sites, providing reasonable address inputs + validation is quite hard. Currently I just follow the fields of the payment gateway, but there is hardly any validation.

@devkral
Copy link

devkral commented Jul 2, 2017

Problematic are provinces vs states, double localizing (de.DEZipCode us.USZipCode, DEStateSelect,...).
I propose to move everything general into the generic package and put the country data and country specific stuff into the country packages.

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

No branches or pull requests

4 participants