Fixed #7575 -- Peru now has regions, not departments (changed at some pointi n
the last year or so). Thanks andresj and programmerq. This is backwards incompatible if you're using the Peruvian localflavor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
567b9f2e28
commit
44e407b7c6
|
@ -7,13 +7,13 @@ from django.forms import ValidationError
|
||||||
from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES
|
from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
class PEDepartmentSelect(Select):
|
class PERegionSelect(Select):
|
||||||
"""
|
"""
|
||||||
A Select widget that uses a list of Peruvian Departments as its choices.
|
A Select widget that uses a list of Peruvian Regions as its choices.
|
||||||
"""
|
"""
|
||||||
def __init__(self, attrs=None):
|
def __init__(self, attrs=None):
|
||||||
from pe_department import DEPARTMENT_CHOICES
|
from pe_region import REGION_CHOICES
|
||||||
super(PEDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_CHOICES)
|
super(PERegionSelect, self).__init__(attrs, choices=REGION_CHOICES)
|
||||||
|
|
||||||
class PEDNIField(CharField):
|
class PEDNIField(CharField):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
A list of Peru departaments as `choices` in a
|
A list of Peru regions as `choices` in a formfield.
|
||||||
formfield.
|
|
||||||
|
|
||||||
This exists in this standalone file so that it's only imported into memory
|
This exists in this standalone file so that it's only imported into memory
|
||||||
when explicitly needed.
|
when explicitly needed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
DEPARTMENT_CHOICES = (
|
REGION_CHOICES = (
|
||||||
('AMA', u'Amazonas'),
|
('AMA', u'Amazonas'),
|
||||||
('ANC', u'Ancash'),
|
('ANC', u'Ancash'),
|
||||||
('APU', u'Apurímac'),
|
('APU', u'Apurímac'),
|
||||||
('ARE', u'Arequipa'),
|
('ARE', u'Arequipa'),
|
||||||
('AYA', u'Ayacucho'),
|
('AYA', u'Ayacucho'),
|
||||||
('CAJ', u'Cajamarca'),
|
('CAJ', u'Cajamarca'),
|
||||||
|
('CAL', u'Callao'),
|
||||||
('CUS', u'Cusco'),
|
('CUS', u'Cusco'),
|
||||||
('HUV', u'Huancavelica'),
|
('HUV', u'Huancavelica'),
|
||||||
('HUC', u'Huánuco'),
|
('HUC', u'Huánuco'),
|
Loading…
Reference in New Issue