umutbozkurt / django-rest-framework-mongoengine

Mongoengine support for Django Rest Framework
MIT License
616 stars 166 forks source link

Is it compatible with django-mongoengine? #206

Open ShipraShalini opened 7 years ago

BurkovBA commented 7 years ago

@ShipraShalini

Yes, it should be.

In brief, until 0.8.8, Mongoengine was developed by Ross Lawley, who passed the project to other maintainers in the late 2014 - early 2015.

Those maintainers released Mongoengine 0.9 and 0.10. In Mongoengine <=0.9, there is a subpackage, called mongoengine.django, which contains compatibility layer for django authentication machinery.

Then new maintainers decided that if there are various compatibility packages such as flask-mongonegine and eve-mongoengine, django is not a special one and the django compatibility code should be moved into a separate package django-mongoengine in Mongoengine 0.10.

On my day job, we make use of Mongoengine 0.9 in our current projects and for authentication we use its mongoengine.django subpackage. I can share my authentication app with you - I'll update django-rest-framework-mongoengine repository with account app that implements authentication in mongoengine.django. Theoretically, django-mongoengine should be compatible with that code.

ShipraShalini commented 7 years ago

If I have Document like:

from django_mongoengine import Document, fields

class Dummy(Document):
    name = fields.StringField()
    value = fields.IntField(required=False)

And use data like: { "name": "abc"}

I still get ValidationError: {'value': [u'This field is required.']}

But If I revert it back to from mongoengine import fields, Document it works.

BurkovBA commented 7 years ago

@ShipraShalini

Wow, something scary is going on there. Why would they override Document in django-mongoengine?:) Sorry, I haven't worked with that part of django-mongoengine. So, not sure about the compatibility.