Author: adrian
Date: 2007-01-23 23:26:48 -0600 (Tue, 23 Jan 2007)
New Revision: 4414

Modified:
   django/branches/newforms-admin/django/db/models/fields/__init__.py
Log:
newforms-admin: Implemented database NullBooleanField.formfield()

Modified: django/branches/newforms-admin/django/db/models/fields/__init__.py
===================================================================
--- django/branches/newforms-admin/django/db/models/fields/__init__.py  
2007-01-24 05:25:02 UTC (rev 4413)
+++ django/branches/newforms-admin/django/db/models/fields/__init__.py  
2007-01-24 05:26:48 UTC (rev 4414)
@@ -735,6 +735,11 @@
     def get_manipulator_field_objs(self):
         return [oldforms.NullBooleanField]
 
+    def formfield(self, **kwargs):
+        defaults = {'required': not self.blank, 'label': 
capfirst(self.verbose_name)}
+        defaults.update(kwargs)
+        return forms.NullBooleanField(**defaults)
+
 class PhoneNumberField(IntegerField):
     def get_manipulator_field_objs(self):
         return [oldforms.PhoneNumberField]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to