My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 65: NullBooleanField and BooleanField
3 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Aug 2009


 
Reported by mikaelmo...@gmail.com, May 3, 2009
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
 Issue 67  has been merged into this issue.
Aug 4, 2009
Project Member #2 rwpoul...@gmail.com
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

Powered by Google Project Hosting