In some cases, a BooleanField returns an integer instead of a bool. The following example uses a MySQL backend:
# models.py
from django.db import models
class Simple(models.Model):
b = models.BooleanField()
$ ./manage.py syncdb
Creating table djest_simple
$ python
Python 2.5 (r25:51908, Sep 10 2007, 13:30:49)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from djest.models import Simple
>>> simple = Simple.objects.create(b=True)
>>> simple.b
True
>>> simple_2 = Simple.objects.get(pk=simple.pk)
>>> simple_2.b
1
This may not be a problem for normal usage, but makes testing, particularly using doctest, much less elegant.