Ticket #14282: localflavor_add_gt_country.patch

File localflavor_add_gt_country.patch, 2.0 KB (added by dmonroy, 14 years ago)

Patch

  • django/contrib/localflavor/gt/forms.py

    ### Eclipse Workspace Patch 1.0
    #P django_svn
     
     1"""
     2Guatemalan-specific form helpers.
     3"""
     4
     5from django.forms.fields import Select
     6
     7class GTDepartmentSelect(Select):
     8    """
     9    A Select widget that uses a list of Guatemalan departments as its choices.
     10    """
     11    def __init__(self, attrs=None):
     12        from gt_departments import DEPARTMENT_CHOICES
     13        super(GTDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_CHOICES)
     14
  • django/contrib/localflavor/gt/gt_departments.py

     
     1# -*- coding: utf-8 -*-
     2"""
     3A list of Guatemalan departments for use as `choices` in a formfield.
     4
     5This exists in this standalone file so that it's only imported into memory
     6when explicitly needed.
     7"""
     8
     9from django.utils.translation import ugettext_lazy as _
     10
     11DEPARTMENT_CHOICES = (
     12    ('AV', _(u'Alta Verapaz')),
     13    ('BV', _(u'Baja Verapaz')),
     14    ('CO', _(u'Chimaltenango')),
     15    ('CA', _(u'Chiquimula')),
     16    ('PE', _(u'Petén')),
     17    ('PR', _(u'El Progreso')),
     18    ('EQ', _(u'El Quiché')),
     19    ('ES', _(u'Escuintla')),
     20    ('GU', _(u'Guatemala')),
     21    ('HH', _(u'Huehuetenango')),
     22    ('IZ', _(u'Izabal')),
     23    ('JA', _(u'Jalapa')),
     24    ('JU', _(u'Jutiapa')),
     25    ('QU', _(u'Quetzaltenango')),
     26    ('RH', _(u'Retalhuleu')),
     27    ('SA', _(u'Sacatepéquez')),
     28    ('SM', _(u'San Marcos')),
     29    ('SR', _(u'Santa Rosa')),
     30    ('SO', _(u'Sololá')),
     31    ('SU', _(u'Suchitepéquez')),
     32    ('TT', _(u'Totonicapán')),
     33    ('ZA', _(u'Zacapa')),
     34)
     35
Back to Top