Toggle table of contents sidebar
BIT(1) Boolean Fields¶Some database systems, such as the Java Hibernate ORM, don’t use MySQL’s bool
data type for storing boolean flags and instead use BIT(1)
. Django’s default BooleanField
and NullBooleanField
classes can’t work with this.
The following subclasses are boolean fields that work with BIT(1)
columns that will help when connecting to a legacy database. If you are using inspectdb
to generate models from the database, use these to replace the TextField
output for your BIT(1)
columns.
A subclass of Django’s BooleanField
that uses the BIT(1)
column type instead of bool
.
Note
Django deprecated NullBooleanField
in version 3.1 and retains it only for use in old migrations. NullBit1BooleanField
is similarly deprecated.
A subclass of Django’s NullBooleanField
that uses the BIT(1)
column type instead of bool
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4