quantifiedcode / python-anti-patterns

An open collection of Python anti-patterns and worst practices.
https://quantifiedcode.github.io/python-anti-patterns
Other
1.71k stars 249 forks source link

NullBooleanField soft-deprecated in Django 2.1, hard-deprecated in Django 3.1 #112

Closed ngnpope closed 4 years ago

ngnpope commented 6 years ago

The Django correctness section mentions using NullBooleanField instead of BooleanField(null=True). The reverse should now be advocated.

Soft-deprecation in Django 2.1 (release notes, pull request) Hard-deprecation in Django 3.1 (release notes, pull request)

vstoykov commented 6 years ago

Yes it's in the release notes:

BooleanField can now be null=True. This is encouraged instead of NullBooleanField, which will likely be deprecated in the future.

https://docs.djangoproject.com/en/2.1/releases/2.1/#models