2011-06-28 18:17:23 +08:00
|
|
|
"""
|
|
|
|
PY-specific Form helpers.
|
|
|
|
"""
|
2011-10-18 08:47:49 +08:00
|
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
from django.contrib.localflavor.py.py_department import DEPARTMENT_CHOICES, DEPARTMENT_ROMAN_CHOICES
|
2011-06-28 18:17:23 +08:00
|
|
|
from django.forms.fields import Select
|
|
|
|
|
2011-10-18 08:47:49 +08:00
|
|
|
|
2011-06-28 18:17:23 +08:00
|
|
|
class PyDepartmentSelect(Select):
|
|
|
|
"""
|
|
|
|
A Select widget with a list of Paraguayan departments as choices.
|
|
|
|
"""
|
|
|
|
def __init__(self, attrs=None):
|
|
|
|
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):
|
|
|
|
super(PyNumberedDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_ROMAN_CHOICES)
|