Opened 17 years ago

Closed 17 years ago

#5692 closed (duplicate)

Countries list for localflavor

Reported by: Davide "Design" Muzzarelli <info@…> Owned by: nobody
Component: contrib.localflavor Version: dev
Severity: Keywords: countries
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is a new file to place in django/contrib/localflavor/generic/

The file include a tuple of counties ISO-3166-1. The country names should be not translated.

My suggestion for the file name is "country.py".

Attachments (1)

country.py (9.6 KB ) - added by Davide "Design" Muzzarelli <info@…> 17 years ago.

Download all attachments as: .zip

Change History (4)

by Davide "Design" Muzzarelli <info@…>, 17 years ago

Attachment: country.py added

comment:1 by Davide "Design" Muzzarelli <info@…>, 17 years ago

Example of use in a model:

from django.contrib.localflavor.generic import country

class UerProfile(models.Model):
   # ...
   country = models.CharField(max_length=2, choices=[(x[0], x[3]) for x in country.COUNTRIES])
   # ...

comment:2 by Simon G <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by Malcolm Tredinnick, 17 years ago

Resolution: duplicate
Status: newclosed

I'm going to close this in favour of #5446, which has a little more functionality and is all ready for localisation.

Note: See TracTickets for help on using tickets.
Back to Top