summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-01 02:35:15 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-01 02:35:15 +0000
commit157ade371be84154f2ce465793531c72d82ecada (patch)
tree80b8333d309daf53d079ea138ac56b74404b2071 /django
parent94cb93edcaa441975082b793bc89927dd182ec26 (diff)
Fixed #4084 -- Added formfield() support to the USStateField model field.
Thanks, polpak@yahoo.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 3849ee73b9..ba2e362f3a 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -869,6 +869,12 @@ class USStateField(Field):
def get_manipulator_field_objs(self):
return [oldforms.USStateField]
+ def formfield(self, **kwargs):
+ from django.contrib.localflavor.us.forms import USStateSelect
+ defaults = {'widget': USStateSelect}
+ defaults.update(kwargs)
+ return super(USStateField, self).formfield(**defaults)
+
class XMLField(TextField):
def __init__(self, verbose_name=None, name=None, schema_path=None, **kwargs):
self.schema_path = schema_path