umutbozkurt/django-rest-framework-mongoengine

rest_framework_mongoengine CreateOnlyDefault() not working

bennik88 opened this issue · 0 comments

It seems like the CreateOnlyDefault() doesn't exist in rest_framework_mongoengine and does not work in combination with rest_framework.

Example:


from rest_framework_mongoengine import serializers


class ProjectCreation(EmbeddedDocument):
    project_created_by = fields.StringField(max_length=50)
    date_of_creation = fields.DateTimeField(
        default=serializers.CreateOnlyDefault(datetime.datetime.utcnow))