Opened 8 years ago

Closed 8 years ago

#5692 closed (duplicate)

Countries list for localflavor

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

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@…> 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Davide "Design" Muzzarelli <info@…>

comment:1 Changed 8 years ago by Davide "Design" Muzzarelli <info@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 8 years ago by Simon G <dev@…>

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 8 years ago by mtredinnick

  • Resolution set to duplicate
  • Status changed from new to closed

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