Python

Python

By DeepSource

Use of deprecated NullBooleanField PTC-W0900

Bug risk Autofix

NullBooleanField is deprecated in favor of BooleanField(null=True) since Django 3.1 and has been removed in Django 3.2. It is recommended to replace it with BooleanField with null=True

Bad practice

class MyModel(models.Model):
    my_field = models.NullBooleanField()

Recommended

class MyModel(models.Model):
    my_field = models.BooleanField(null=True)