A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://django-mysql.readthedocs.io/en/latest/model_fields/null_bit1_boolean_fields.html below:

BIT(1) Boolean Fields - django-mysql 4.17.0 documentation

Back to top

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.

class Bit1BooleanField

A subclass of Django’s BooleanField that uses the BIT(1) column type instead of bool.

class NullBit1BooleanField

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