#12761: Paraguayan local flavor
-------------------------------------------------+--------------------------
Reporter: dschulz | Owner: nobody
Status: new | Milestone:
Component: django.contrib.localflavor | Version: 1.1
Resolution: | Keywords: local flavor
paraguay
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------------+--------------------------
Changes (by dschulz):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
'''Tarball contents follows:
'''py_departments.py:'''
{{{
# -*- coding: utf-8 -*-
"""
Paraguayan departments ready to use as choices in ChoiceFields.
Source: http://www.opaci.org.py/index.php?option=com_wrapper&Itemid=32
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
DEPARTMENT_CHOICES = (
('A', u'Concepción'),
('B', u'San Pedro'),
('C', u'Cordillera'),
('D', u'Guairá'),
('E', u'Caaguazú'),
('F', u'Caazapá'),
('G', u'Itapúa'),
('H', u'Misiones'),
('I', u'Paraguarí'),
('J', u'Alto Paraná'),
('K', u'Central'),
('L', u'Ñeembucú'),
('M', u'Amambay'),
('N', u'Canindeyú'),
('O', u'Pdte. Hayes'),
('P', u'Alto Paraguay'),
('Q', u'Boquerón'),
)
DEPARTMENT_ROMAN_CHOICES = (
('A', u'I Concepción'),
('B', u'II San Pedro'),
('C', u'III Cordillera'),
('D', u'IV Guairá'),
('E', u'V Caaguazú'),
('F', u'VI Caazapá'),
('G', u'VII Itapúa'),
('H', u'VIII Misiones'),
('I', u'IX Paraguarí'),
('J', u'X Alto Paraná'),
('K', u'XI Central'),
('L', u'XII Ñeembucú'),
('M', u'XIII Amambay'),
('N', u'XIV Canindeyú'),
('O', u'XV Pdte. Hayes'),
('P', u'XVI Alto Paraguay'),
('Q', u'XVII Boquerón'),
)
}}}
forms.py:'''
{{{
# -*- coding: utf-8 -*-
"""
PY-specific Form helpers.
"""
from django.forms import ValidationError
from django.forms.fields import RegexField, CharField, Select,
EMPTY_VALUES
#from django.utils.encoding import smart_unicode
#from django.utils.translation import ugettext_lazy as _
class PyDepartmentSelect(Select):
"""
A Select widget with a list of Paraguayan departments as choices.
"""
def __init__(self, attrs=None):
from py_departments import DEPARTMENT_CHOICES
super(PyDepartmentSelect, self).__init__(attrs,
choices=DEPARTMENT_CHOICES)
class PyNumeratedDepartmentSelect(Select):
"""
A Select widget with a roman numerated list of Paraguayan departments
as choices.
"""
def __init__(self, attrs=None):
from py_departments import DEPARTMENT_ROMAN_CHOICES
super(PyNumeratedDepartmentSelect, self).__init__(attrs,
choices=DEPARTMENT_ROMAN_CHOICES)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12761#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.