diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-01 02:35:15 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-01 02:35:15 +0000 |
| commit | 157ade371be84154f2ce465793531c72d82ecada (patch) | |
| tree | 80b8333d309daf53d079ea138ac56b74404b2071 | |
| parent | 94cb93edcaa441975082b793bc89927dd182ec26 (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
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | django/db/models/fields/__init__.py | 6 |
2 files changed, 7 insertions, 0 deletions
@@ -181,6 +181,7 @@ answer newbie questions, and generally made Django that much better: Luke Plant <http://lukeplant.me.uk/> plisk Daniel Poelzleithner <http://poelzi.org/> + polpak@yahoo.com J. Rademaker Michael Radziej <mir@noris.de> ramiro 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 |
