Issue
After upgrading djangorestframework from djangorestframework==3.13.1
to djangorestframework==3.14.0
the code
from rest_framework.serializers import NullBooleanField
Throws
AttributeError: module 'rest_framework.serializers' has no attribute 'NullBooleanField'
Reading the release notes I don't see a deprecation. Where did it go?
Solution
For what it's worth, there's a deprecation warning in the previous version, which also suggests a fix:
The
NullBooleanField
is deprecated and will be removed starting with 3.14. Instead use theBooleanField
field and setallow_null=True
which does the same thing.
Answered By - djvg
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.