Author: russellm
Date: 2006-07-18 23:17:24 -0500 (Tue, 18 Jul 2006)
New Revision: 3371

Modified:
   django/trunk/django/db/models/fields/__init__.py
Log:
Modified to_python method for BooleanField so that the to_python(str(bool_val)) 
round trip works. This was causing problems with the serializers. 

Modified: django/trunk/django/db/models/fields/__init__.py
===================================================================
--- django/trunk/django/db/models/fields/__init__.py    2006-07-19 02:46:18 UTC 
(rev 3370)
+++ django/trunk/django/db/models/fields/__init__.py    2006-07-19 04:17:24 UTC 
(rev 3371)
@@ -364,8 +364,8 @@
 
     def to_python(self, value):
         if value in (True, False): return value
-        if value is 't': return True
-        if value is 'f': return False
+        if value is 't' or value is 'True': return True
+        if value is 'f' or value is 'False': return False
         raise validators.ValidationError, gettext("This value must be either 
True or False.")
 
     def get_manipulator_field_objs(self):


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

Reply via email to