| Issue 65: | NullBooleanField and BooleanField | |
| 3 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. use latest svn version of Django and django-forum 2. run manage.py syncdb What is the expected output? What do you see instead? Error: One or more models did not validate: forum.thread: "sticky": BooleanFields do not accept null values. Use a NullBooleanField instead. forum.thread: "closed": BooleanFields do not accept null values. Use a NullBooleanField instead. What version of the product are you using? On what operating system? latest svn version of django-forum (rev 45) latest svn version of django (rev 10665) Please provide any additional information below. simple solution: models.py: try: from django.db.models import NullBooleanField except ImportError: from django.db.models import BooleanField as NullBooleanField
Aug 4, 2009
Project Member
#1
rwpoul...@gmail.com
Aug 4, 2009
I have fixed this by removing the null=True from the BooleanFields and forcing the default to False. I would suggest updating all existing records with this SQL query: UPDATE forum_thread SET sticky='f' WHERE sticky=''; UPDATE forum_thread SET closed='f' WHERE closed=''; Change is in SVN r46.
Status:
Fixed
|