acu192 opened this issue 3 years ago · 1 comments
Because of this line:
django-rest-framework-mongoengine/rest_framework_mongoengine/utils.py
Line 147 in 2ab11b3
If default is "falsy" (like if you do default=0 on an IntField) then the default is ignored.
default
default=0
IntField
A workaround is to do default=lambda: 0 on your ME fields, instead of just the simple default=0.
default=lambda: 0