Re: countries model or list like settings.LANGUAGES

2011-05-05 Thread Hanne Moa
On 1 May 2011 15:33, Mateusz Harasymczuk  wrote:
> I have to agree with this guy:
> http://code.djangoproject.com/ticket/5446

There are two competing third-party solutions to a country-field out
there, both helpfully named django-countries:

1) http://code.google.com/p/django-countries/
2) https://bitbucket.org/smileychris/django-countries/

No. #1 uses a country model, a foreign-key to this model is then a
"country"-field. No. #2 has the countries in a tuple and a proper
CountryField. The former is the first hit on google and it is easy to
change the list of countries, in the latter you need one fewer JOIN.
The latter is also more used, and is the only one on pypi and
djangopackages.

The keys of the  model used in #1 is compatible with the values of #2
but of course the allowed values differ.

We could just pick one of these.


HM

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



countries model or list like settings.LANGUAGES

2011-05-01 Thread Mateusz Harasymczuk
I have to agree with this guy:

http://code.djangoproject.com/ticket/5446

There should be a model to hold country name and language:


{% quote %}
The idea is to have something like:

country = models.CountryField()
language = models.LanguageField() 

Instead of:

lang = models.CharField ( max_length=5, choices=settings.LANGUAGES)

and

COUNTRIES = (
('fr', _('France')),
('de', _('Germany')),
...
)

country = models.CharField(max_length=10, choices=COUNTRIES) 

which requires redoing the translation work and which is tedious to manually 
maintain.

{% endquote %}

However this is 4 years old and still not resolved.
How about making such dict:

{
  'ISO-2 letter code': {
'fullname': _('Country full name'),
'iso-3 letter code': 'ISO',
'languages': [
('is_O1', _('lang native name')),
('is_O2', _('lang native name2')),
  },
  ... and so on ...
}

This is only a suggestion how it may look like.
However this topic seems to be a pretty important for I think lots of 
developers.

At least provide a COUNTRIES list like LANGUAGES list.



--
Matt Harasymczuk
www.matt.harasymczuk.pl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.