Fixed #7190. Boolean fields now return bool values instead of 1 or 0. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12578 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2010-02-24 17:36:18 +00:00
parent 9f4bf525f8
commit 16fe73d918
5 changed files with 47 additions and 24 deletions

View file

@ -326,12 +326,11 @@ Notes on specific fields
Boolean fields
~~~~~~~~~~~~~~
Since MySQL doesn't have a direct ``BOOLEAN`` column type, Django uses a
``TINYINT`` column with values of ``1`` and ``0`` to store values for the
:class:`~django.db.models.BooleanField` model field. Refer to the documentation
of that field for more details, but usually this won't be something that will
matter unless you're printing out the field values and are expecting to see
``True`` and ``False.``.
.. versionchanged:: 1.2
In previous versions of Django when running under MySQL ``BooleanFields`` would
return their data as ``ints``, instead of true ``bools``. See the release
notes for a complete description of the change.
Character fields
~~~~~~~~~~~~~~~~