summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-28 10:17:23 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-28 10:17:23 +0000
commitf801e2c15dee8bf711bcccc932ef9f0ca89a0e8b (patch)
tree3c5b723b6697c32f5c98b4121b2515e30a5da1f1 /django
parent54552ee29f5e24f6aefead31b7097252490c05f3 (diff)
Fixed #12761 -- Added Paraguayan local flavor. Thanks, dschulz and BernhardEssl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/localflavor/py/__init__.py0
-rw-r--r--django/contrib/localflavor/py/forms.py21
-rw-r--r--django/contrib/localflavor/py/py_department.py45
3 files changed, 66 insertions, 0 deletions
diff --git a/django/contrib/localflavor/py/__init__.py b/django/contrib/localflavor/py/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/django/contrib/localflavor/py/__init__.py
diff --git a/django/contrib/localflavor/py/forms.py b/django/contrib/localflavor/py/forms.py
new file mode 100644
index 0000000000..85ddffd82f
--- /dev/null
+++ b/django/contrib/localflavor/py/forms.py
@@ -0,0 +1,21 @@
+"""
+PY-specific Form helpers.
+"""
+from django.forms.fields import Select
+
+class PyDepartmentSelect(Select):
+ """
+ A Select widget with a list of Paraguayan departments as choices.
+ """
+ def __init__(self, attrs=None):
+ from py_department import DEPARTMENT_CHOICES
+ super(PyDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_CHOICES)
+
+
+class PyNumberedDepartmentSelect(Select):
+ """
+ A Select widget with a roman numbered list of Paraguayan departments as choices.
+ """
+ def __init__(self, attrs=None):
+ from py_department import DEPARTMENT_ROMAN_CHOICES
+ super(PyNumberedDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_ROMAN_CHOICES)
diff --git a/django/contrib/localflavor/py/py_department.py b/django/contrib/localflavor/py/py_department.py
new file mode 100644
index 0000000000..28c613b9a0
--- /dev/null
+++ b/django/contrib/localflavor/py/py_department.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+# http://www.statoids.com/upy.html
+
+DEPARTMENT_CHOICES = (
+ ('AG', u'Alto Paraguay'),
+ ('AA', u'Alto Paraná'),
+ ('AM', u'Amambay'),
+ ('AS', u'Asunción'),
+ ('BQ', u'Boquerón'),
+ ('CG', u'Caaguazú'),
+ ('CZ', u'Caazapá'),
+ ('CY', u'Canindeyú'),
+ ('CE', u'Central'),
+ ('CN', u'Concepción'),
+ ('CR', u'Cordillera'),
+ ('GU', u'Guairá'),
+ ('IT', u'Itapúa'),
+ ('MI', u'Misiones'),
+ ('NE', u'Ñeembucú'),
+ ('PG', u'Paraguarí'),
+ ('PH', u'Pdte. Hayes'),
+ ('SP', u'San Pedro'),
+)
+
+DEPARTMENT_ROMAN_CHOICES = (
+ ('CN', u'I Concepción'),
+ ('SP', u'II San Pedro'),
+ ('CR', u'III Cordillera'),
+ ('GU', u'IV Guairá'),
+ ('CG', u'V Caaguazú'),
+ ('CZ', u'VI Caazapá'),
+ ('IT', u'VII Itapúa'),
+ ('MI', u'VIII Misiones'),
+ ('PG', u'IX Paraguarí'),
+ ('AA', u'X Alto Paraná'),
+ ('CE', u'XI Central'),
+ ('NE', u'XII Ñeembucú'),
+ ('AM', u'XIII Amambay'),
+ ('CY', u'XIV Canindeyú'),
+ ('PH', u'XV Pdte. Hayes'),
+ ('AG', u'XVI Alto Paraguay'),
+ ('BQ', u'XVII Boquerón'),
+ ('AS', u'XVIII Asunción'),
+)