coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
920 stars 374 forks source link

alt_names with django-parler #170

Closed moorchegue closed 6 years ago

moorchegue commented 7 years ago

Not really an issue, just a question, maybe an idea.

By the look of it alt_names uses a data structure very similar to what's being used by django-parler. If that assumption is correct, would it be feasible to use django-parler for this purpose?

One of the benefits could be leveraging its integrations with Django REST Framework and Django admin interface.

Is it even a sane idea? Any thoughts on how to implement this and how hard would it be?

The reason I'm interested in this is that I have a project with an API that supports data translations, and django-cities (while being absolutely awesome overall) is the only part that treats translations slightly differently. Which makes me want to make things better aligned.

I'd be grateful for any thoughts.

blag commented 6 years ago

This is an interesting idea, but the alternative names in django-cities aren't really tied into translations, they are really more for enabling autocomplete functionality in multiple languages, which is slightly different (the vast majority of alternative names in d-c are missing critical translation information).

I think integrating django-cities and django-parler would be a good idea for those people looking to implement autocomplete on top of a translation layer, and I'm open to a PR.

moorchegue commented 6 years ago

Oh, yeah, that makes perfect sense. Although I'm not sure how that would work exactly yet. Next time I run into this I'll try to give it a better thought and maybe come up with something now that I understand what alt_names are considered conceptually. Thanks!

blag commented 6 years ago

I'm going to close this, but feel free to continue discussion or ask me to reopen it if you have any more ideas regarding this. Thanks!