Ticket #6212: NullBooleanField_formfield.diff

File NullBooleanField_formfield.diff, 717 bytes (added by anonymous, 17 years ago)

patch to add the missing method

Line 
1Index: django/db/models/fields/__init__.py
2
3===================================================================
4
5--- django/db/models/fields/__init__.py (revision 6918)
6
7+++ django/db/models/fields/__init__.py (working copy)
8
9@@ -906,6 +906,11 @@
10
11 def get_manipulator_field_objs(self):
12 return [oldforms.NullBooleanField]
13
14+ def formfield(self, **kwargs):
15+ defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
16+ defaults.update(kwargs)
17+ return forms.NullBooleanField(**defaults)
18+
19 class PhoneNumberField(IntegerField):
20 def get_manipulator_field_objs(self):
21 return [oldforms.PhoneNumberField]
Back to Top