NullBooleanField
is deprecated and will be removed a future version of Django.
NullBooleanField is like BooleanField with null=True.
Historically the only values BooleanField accepted was True and False. BooleanField didn't permit null=True. If null was a valid value then NullBooleanField was used instead.
If our GitHub code review bot spots this issue in your pull request it gives this advice:
1 | + | class CommentModel(models.Model): | |
2 | + | is_active = models.NullBooleanField() |
NullBooleanField
is deprecated and will be removed a future version of Django.
- | is_active = models.NullBooleanField() |
+ | is_active = models.BooleanField(null=True) |
3 | + | body = models.TextField() |