Open acu192 opened 3 years ago
Because of this line: https://github.com/umutbozkurt/django-rest-framework-mongoengine/blob/2ab11b39428f5c3ecc0712885884e3c325528e66/rest_framework_mongoengine/utils.py#L147
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
Because of this line: https://github.com/umutbozkurt/django-rest-framework-mongoengine/blob/2ab11b39428f5c3ecc0712885884e3c325528e66/rest_framework_mongoengine/utils.py#L147
If
default
is "falsy" (like if you dodefault=0
on anIntField
) then the default is ignored.