Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4084 -- Added formfield() support to the USStateField model fi…

…eld.

Thanks, polpak@yahoo.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 157ade371be84154f2ce465793531c72d82ecada 1 parent 94cb93e
Malcolm Tredinnick authored May 01, 2007
1  AUTHORS
@@ -181,6 +181,7 @@ answer newbie questions, and generally made Django that much better:
181 181
     Luke Plant <http://lukeplant.me.uk/>
182 182
     plisk
183 183
     Daniel Poelzleithner <http://poelzi.org/>
  184
+    polpak@yahoo.com
184 185
     J. Rademaker
185 186
     Michael Radziej <mir@noris.de>
186 187
     ramiro
6  django/db/models/fields/__init__.py
@@ -869,6 +869,12 @@ class USStateField(Field):
869 869
     def get_manipulator_field_objs(self):
870 870
         return [oldforms.USStateField]
871 871
 
  872
+    def formfield(self, **kwargs):
  873
+        from django.contrib.localflavor.us.forms import USStateSelect
  874
+        defaults = {'widget': USStateSelect}
  875
+        defaults.update(kwargs)
  876
+        return super(USStateField, self).formfield(**defaults)
  877
+
872 878
 class XMLField(TextField):
873 879
     def __init__(self, verbose_name=None, name=None, schema_path=None, **kwargs):
874 880
         self.schema_path = schema_path

0 notes on commit 157ade3

Please sign in to comment.
Something went wrong with that request. Please try again.