Ticket #8013: localflavor-co_ec.diff
File localflavor-co_ec.diff, 10.0 KB (added by , 13 years ago) |
---|
-
docs/ref/contrib/localflavor.txt
44 44 * Canada_ 45 45 * Chile_ 46 46 * China_ 47 * Colombia_ 47 48 * Croatia_ 48 49 * Czech_ 50 * Ecuador_ 49 51 * Finland_ 50 52 * France_ 51 53 * Germany_ … … 98 100 .. _Canada: `Canada (ca)`_ 99 101 .. _Chile: `Chile (cl)`_ 100 102 .. _China: `China (cn)`_ 103 .. _Colombia: `Colombia (co)`_ 101 104 .. _Croatia: `Croatia (hr)`_ 102 105 .. _Czech: `Czech (cz)`_ 106 .. _Ecuador: `Ecuador (ec)`_ 103 107 .. _Finland: `Finland (fi)`_ 104 108 .. _France: `France (fr)`_ 105 109 .. _Germany: `Germany (de)`_ … … 392 396 Valid formats are like 1XXXXXXXXXX, where X is digit. 393 397 The second digit could only be 3, 5 and 8. 394 398 399 Colombia (``co``) 400 ============================================ 401 402 .. class:: co.forms.CoDepartmentSelect 403 404 A ``Select`` widget that uses a list of Colombian departments as its choices. 405 406 395 407 Croatia (``hr``) 396 408 ================ 397 409 … … 479 491 480 492 A ``Select`` widget that uses a list of Czech regions as its choices. 481 493 494 Ecuador (``ec``) 495 ================ 496 497 .. class:: ec.forms.EcProvinceSelect 498 499 A ``Select`` widget that uses a list of Ecuatorian provinces as its choices. 500 482 501 Finland (``fi``) 483 502 ================ 484 503 -
tests/regressiontests/forms/tests/__init__.py
21 21 CHLocalFlavorTests, 22 22 CLLocalFlavorTests, 23 23 CNLocalFlavorTests, 24 COLocalFlavorTests, 24 25 CZLocalFlavorTests, 25 26 DELocalFlavorTests, 27 ECLocalFlavorTests, 26 28 ESLocalFlavorTests, 27 29 FILocalFlavorTests, 28 30 FRLocalFlavorTests, -
tests/regressiontests/forms/localflavor/co.py
1 from django.contrib.localflavor.co.forms import CODepartmentSelect 2 3 from utils import LocalFlavorTestCase 4 5 class COLocalFlavorTests(LocalFlavorTestCase): 6 def test_CODepartmentSelect(self): 7 d = CODepartmentSelect() 8 out = u'''<select name="department"> 9 <option value="AMA">Amazonas</option> 10 <option value="ANT">Antioquia</option> 11 <option value="ARA">Arauca</option> 12 <option value="ATL">Atl\xe1ntico</option> 13 <option value="DC">Bogot\xe1</option> 14 <option value="BOL">Bol\xedvar</option> 15 <option value="BOY">Boyac\xe1</option> 16 <option value="CAL">Caldas</option> 17 <option value="CAQ">Caquet\xe1</option> 18 <option value="CAS">Casanare</option> 19 <option value="CAU">Cauca</option> 20 <option value="CES">Cesar</option> 21 <option value="COR" selected="selected">C\xf3rdoba</option> 22 <option value="CUN">Cundinamarca</option> 23 <option value="CHO">Choc\xf3</option> 24 <option value="GUA">Guain\xeda</option> 25 <option value="GUV">Guaviare</option> 26 <option value="HUI">Huila</option> 27 <option value="LAG">La Guajira</option> 28 <option value="MAG">Magdalena</option> 29 <option value="MET">Meta</option> 30 <option value="NAR">Nari\xf1o</option> 31 <option value="NSA">Norte De Santander</option> 32 <option value="PUT">Putumayo</option> 33 <option value="QUI">Quind\xedo</option> 34 <option value="RIS">Risaralda</option> 35 <option value="SAP">San Andr\xe9s, Providencia y Santa Catalina</option> 36 <option value="SAN">Santander</option> 37 <option value="SUC">Sucre</option> 38 <option value="TOL">Tolima</option> 39 <option value="VAC">Valle Del Cauca</option> 40 <option value="VAU">Vaup\xe9s</option> 41 <option value="VID">Vichada</option> 42 </select>''' 43 self.assertEqual(d.render('department', 'COR'), out) -
tests/regressiontests/forms/localflavor/ec.py
1 from django.contrib.localflavor.ec.forms import ECProvinceSelect 2 3 from utils import LocalFlavorTestCase 4 5 class ECLocalFlavorTests(LocalFlavorTestCase): 6 def test_ECProvinceSelect(self): 7 p = ECProvinceSelect() 8 out = u'''<select name="province"> 9 <option value="A">Azuay</option> 10 <option value="B">Bol\xedvar</option> 11 <option value="F">Ca\xf1ar</option> 12 <option value="C">Carchi</option> 13 <option value="X">Cotopaxi</option> 14 <option value="H">Chimborazo</option> 15 <option value="O">El Oro</option> 16 <option value="E">Esmeraldas</option> 17 <option value="W">Gal\xe1pagos</option> 18 <option value="G">Guayas</option> 19 <option value="I">Imbabura</option> 20 <option value="L">Loja</option> 21 <option value="R">Los R\xedos</option> 22 <option value="M">Manab\xed</option> 23 <option value="S">Morona Santiago</option> 24 <option value="N">Napo</option> 25 <option value="D">Orellana</option> 26 <option value="Y">Pastaza</option> 27 <option value="P">Pichincha</option> 28 <option value="SE">Santa Elena</option> 29 <option value="SD">Sto. Domingo De Los Ts\xe1chilas</option> 30 <option value="U" selected="selected">Sucumb\xedos</option> 31 <option value="T">Tungurahua</option> 32 <option value="Z">Zamora Chinchipe</option> 33 </select>''' 34 self.assertEqual(p.render('province', 'U'), out) -
tests/regressiontests/forms/localflavortests.py
7 7 from localflavor.ca import CALocalFlavorTests 8 8 from localflavor.ch import CHLocalFlavorTests 9 9 from localflavor.cl import CLLocalFlavorTests 10 from localflavor.cn import CNLocalFlavorTests 10 11 from localflavor.cz import CZLocalFlavorTests 11 from localflavor.c n import CNLocalFlavorTests12 from localflavor.co import COLocalFlavorTests 12 13 from localflavor.de import DELocalFlavorTests 14 from localflavor.ec import ECLocalFlavorTests 13 15 from localflavor.es import ESLocalFlavorTests 14 16 from localflavor.fi import FILocalFlavorTests 15 17 from localflavor.fr import FRLocalFlavorTests -
django/contrib/localflavor/ec/ec_provinces.py
1 # -*- coding: utf-8 -*- 2 """ 3 A list of Ecuador departaments as `choices` in a 4 formfield. 5 6 This exists in this standalone file so that it's only 7 imported into memory when explicitly needed. 8 """ 9 10 PROVINCE_CHOICES = ( 11 ('A',u'Azuay'), 12 ('B',u'Bolívar'), 13 ('F',u'Cañar'), 14 ('C',u'Carchi'), 15 ('X',u'Cotopaxi'), 16 ('H',u'Chimborazo'), 17 ('O',u'El Oro'), 18 ('E',u'Esmeraldas'), 19 ('W',u'Galápagos'), 20 ('G',u'Guayas'), 21 ('I',u'Imbabura'), 22 ('L',u'Loja'), 23 ('R',u'Los Ríos'), 24 ('M',u'Manabí'), 25 ('S',u'Morona Santiago'), 26 ('N',u'Napo'), 27 ('D',u'Orellana'), 28 ('Y',u'Pastaza'), 29 ('P',u'Pichincha'), 30 ('SE',u'Santa Elena'), 31 ('SD',u'Sto. Domingo De Los Tsáchilas'), 32 ('U',u'Sucumbíos'), 33 ('T',u'Tungurahua'), 34 ('Z',u'Zamora Chinchipe'), 35 ) -
django/contrib/localflavor/ec/forms.py
1 """ 2 Ecuador-specific form helpers. 3 """ 4 5 from django.forms.fields import Select 6 7 class 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) -
django/contrib/localflavor/co/forms.py
1 """ 2 Colombian-specific form helpers. 3 """ 4 5 from django.forms.fields import Select 6 7 class 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) -
django/contrib/localflavor/co/co_departments.py
1 # -*- coding: utf-8 -*- 2 """ 3 A list of Colombian departaments as `choices` in a 4 formfield. 5 6 This exists in this standalone file so that it's only 7 imported into memory when explicitly needed. 8 """ 9 10 DEPARTMENT_CHOICES = ( 11 ('AMA',u'Amazonas'), 12 ('ANT',u'Antioquia'), 13 ('ARA',u'Arauca'), 14 ('ATL',u'Atlántico'), 15 ('DC',u'Bogotá'), 16 ('BOL',u'Bolívar'), 17 ('BOY',u'Boyacá'), 18 ('CAL',u'Caldas'), 19 ('CAQ',u'Caquetá'), 20 ('CAS',u'Casanare'), 21 ('CAU',u'Cauca'), 22 ('CES',u'Cesar'), 23 ('COR',u'Córdoba'), 24 ('CUN',u'Cundinamarca'), 25 ('CHO',u'Chocó'), 26 ('GUA',u'Guainía'), 27 ('GUV',u'Guaviare'), 28 ('HUI',u'Huila'), 29 ('LAG',u'La Guajira'), 30 ('MAG',u'Magdalena'), 31 ('MET',u'Meta'), 32 ('NAR',u'Nariño'), 33 ('NSA',u'Norte De Santander'), 34 ('PUT',u'Putumayo'), 35 ('QUI',u'Quindío'), 36 ('RIS',u'Risaralda'), 37 ('SAP',u'San Andrés, Providencia y Santa Catalina'), 38 ('SAN',u'Santander'), 39 ('SUC',u'Sucre'), 40 ('TOL',u'Tolima'), 41 ('VAC',u'Valle Del Cauca'), 42 ('VAU',u'Vaupés'), 43 ('VID',u'Vichada'), 44 )