Thursday, May 27, 2010

IntegrityError with BooleanField and Postgresql

I have this simple Blog model:

class Blog(models.Model):

title = models.CharField(_('title'), max_length=60, blank=True,
null=True)
body = models.TextField(_('body'))
user = models.ForeignKey(User)
is_public = models.BooleanField(_('is public'), default = True)

When I insert a blog in admin interface, I get this error:

IntegrityError at /admin/blogs/blog/add/

null value in column "is_public" violates not-null constraint

Why ???

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment