Fixed #6212 -- Give models.NullBooleanField the right default newforms field. Patch from SmileyChris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6935 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-12-17 10:35:53 +00:00
parent 931764ddb5
commit 9229c34163
1 changed files with 9 additions and 4 deletions

View File

@ -906,6 +906,11 @@ class NullBooleanField(Field):
def get_manipulator_field_objs(self): def get_manipulator_field_objs(self):
return [oldforms.NullBooleanField] return [oldforms.NullBooleanField]
def formfield(self, **kwargs):
defaults = {'form_class': forms.NullBooleanField}
defaults.update(kwargs)
return super(NullBooleanField, self).formfield(**defaults)
class PhoneNumberField(IntegerField): class PhoneNumberField(IntegerField):
def get_manipulator_field_objs(self): def get_manipulator_field_objs(self):
return [oldforms.PhoneNumberField] return [oldforms.PhoneNumberField]