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
This commit is contained in:
Malcolm Tredinnick 2007-05-01 02:35:15 +00:00
parent 94cb93edca
commit 157ade371b
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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