Ticket #8013: localflavor-coec.patch

File localflavor-coec.patch, 6.3 KB (added by Igor Támara, 16 years ago)
  • django/contrib/localflavor/ec/ec_provinces.py

     
     1# -*- coding: utf-8 -*-
     2"""
     3A list of Ecuador departaments as `choices` in a
     4formfield.
     5
     6This exists in this standalone file so that it's only imported into memory
     7when explicitly needed.
     8"""
     9
     10PROVINCE_CHOICES = (
     11        ('01',u'Azuay'),
     12        ('02',u'Bolívar'),
     13        ('03',u'Cañar'),
     14        ('04',u'Carchi'),
     15        ('05',u'Cotopaxi'),
     16        ('06',u'Chimborazo'),
     17        ('07',u'El Oro'),
     18        ('08',u'Esmeraldas'),
     19        ('09',u'Guayas'),
     20        ('10',u'Imbabura'),
     21        ('11',u'Loja'),
     22        ('12',u'Los Ríos'),
     23        ('13',u'Manabí'),
     24        ('14',u'Morona Santiago'),
     25        ('15',u'Napo'),
     26        ('16',u'Pastaza'),
     27        ('17',u'Pichincha'),
     28        ('18',u'Tungurahua'),
     29        ('19',u'Zamora Chinchipe'),
     30        ('20',u'Galápagos'),
     31        ('21',u'Sucumbíos'),
     32        ('22',u'Orellana'),
     33        ('23',u'Sto. Domingo De Los Tsáchilas'),
     34        ('24',u'Santa Elena'),
     35)
  • django/contrib/localflavor/ec/forms.py

     
     1"""
     2Ecuador-specific form helpers.
     3"""
     4
     5from django.forms.fields import Select
     6
     7class ECProvinceSelect(Select):
     8    """
     9    A Select widget that uses a list of Ecuador provinces as its choices.
     10    """
     11    def __init__(self, attrs=None):
     12        from ec_provinces import PROVINCE_CHOICES
     13        super(ECProvinceSelect, self).__init__(choices=PROVINCE_CHOICES)
     14
  • django/contrib/localflavor/co/forms.py

     
     1"""
     2Colombian-specific form helpers.
     3"""
     4
     5from django.forms.fields import Select
     6
     7class CODepartmentSelect(Select):
     8    """
     9    A Select widget that uses a list of Colombian states as its choices.
     10    """
     11    def __init__(self, attrs=None):
     12        from co_departments import DEPARTMENT_CHOICES
     13        super(CODepartmentSelect, self).__init__(choices=DEPARTMENT_CHOICES)
     14
  • django/contrib/localflavor/co/co_departments.py

     
     1# -*- coding: utf-8 -*-
     2"""
     3A list of Colombian departaments as `choices` in a
     4formfield.
     5
     6This exists in this standalone file so that it's only imported into memory
     7when explicitly needed.
     8"""
     9
     10DEPARTMENT_CHOICES = (
     11        ('05',u'Antioquia'),
     12        ('08',u'Atlántico'),
     13        ('11',u'Bogotá'),
     14        ('13',u'Bolívar'),
     15        ('15',u'Boyacá'),
     16        ('17',u'Caldas'),
     17        ('18',u'Caquetá'),
     18        ('19',u'Cauca'),
     19        ('20',u'Cesar'),
     20        ('23',u'Córdoba'),
     21        ('25',u'Cundinamarca'),
     22        ('27',u'Chocó'),
     23        ('41',u'Huila'),
     24        ('44',u'La Guajira'),
     25        ('47',u'Magdalena'),
     26        ('50',u'Meta'),
     27        ('52',u'Nariño'),
     28        ('54',u'Norte De Santander'),
     29        ('63',u'Quindío'),
     30        ('66',u'Risaralda'),
     31        ('68',u'Santander'),
     32        ('70',u'Sucre'),
     33        ('73',u'Tolima'),
     34        ('76',u'Valle Del Cauca'),
     35        ('81',u'Arauca'),
     36        ('85',u'Casanare'),
     37        ('86',u'Putumayo'),
     38        ('88',u'San Andrés'),
     39        ('91',u'Amazonas'),
     40        ('94',u'Guainía'),
     41        ('95',u'Guavire'),
     42        ('97',u'Vaupés'),
     43        ('99',u'Vichada'),
     44)
  • tests/regressiontests/forms/tests.py

     
    1010from localflavor.ca import tests as localflavor_ca_tests
    1111from localflavor.ch import tests as localflavor_ch_tests
    1212from localflavor.cl import tests as localflavor_cl_tests
     13from localflavor.co import tests as localflavor_co_tests
    1314from localflavor.de import tests as localflavor_de_tests
     15from localflavor.ec import tests as localflavor_ec_tests
    1416from localflavor.es import tests as localflavor_es_tests
    1517from localflavor.fi import tests as localflavor_fi_tests
    1618from localflavor.fr import tests as localflavor_fr_tests
     
    4345    'localflavor_ca_tests': localflavor_ca_tests,
    4446    'localflavor_ch_tests': localflavor_ch_tests,
    4547    'localflavor_cl_tests': localflavor_cl_tests,
     48    'localflavor_co_tests': localflavor_co_tests,
    4649    'localflavor_de_tests': localflavor_de_tests,
     50    'localflavor_ec_tests': localflavor_ec_tests,
    4751    'localflavor_es_tests': localflavor_es_tests,
    4852    'localflavor_fi_tests': localflavor_fi_tests,
    4953    'localflavor_fr_tests': localflavor_fr_tests,
  • docs/localflavor.txt

     
    3636    * Brazil_
    3737    * Canada_
    3838    * Chile_
     39    * Colombia_
     40    * Ecuador_
    3941    * Finland_
    4042    * France_
    4143    * Germany_
     
    7577.. _Brazil: `Brazil (django.contrib.localflavor.br)`_
    7678.. _Canada: `Canada (django.contrib.localflavor.ca)`_
    7779.. _Chile: `Chile (django.contrib.localflavor.cl)`_
     80.. _Colombia: `Colombia (django.contrib.localflavor.co)`_
     81.. _Ecuador: `Ecuador (django.contrib.localflavor.ec)`_
    7882.. _Finland: `Finland (django.contrib.localflavor.fi)`_
    7983.. _France: `France (django.contrib.localflavor.fr)`_
    8084.. _Germany: `Germany (django.contrib.localflavor.de)`_
     
    244248A ``Select`` widget that uses a list of Chilean regions (Regiones) as its
    245249choices.
    246250
     251Colombia (``django.contrib.localflavor.co``)
     252============================================
     253
     254CoDepartmentSelect
     255-------------
     256
     257A ``Select`` widget that uses a list of Colombian departments as its choices.
     258
     259
     260Ecuador (``django.contrib.localflavor.ec``)
     261===========================================
     262
     263EcProvinceSelect
     264-------------
     265
     266A ``Select`` widget that uses a list of Ecuatorian provinces as its choices.
     267
    247268Finland (``django.contrib.localflavor.fi``)
    248269===========================================
    249270
Back to Top