Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageField returns Null with DRF #1387

Open
jcodebrain opened this issue Oct 13, 2016 · 2 comments
Open

ImageField returns Null with DRF #1387

jcodebrain opened this issue Oct 13, 2016 · 2 comments

Comments

@jcodebrain
Copy link

jcodebrain commented Oct 13, 2016

I am using DRF v3 and mongoengine.
In my Mongodb, image field has been well inserted like ("image_file" : ObjectId("57ff54681d41c8bf44ddc047")
However, when I use the DocumentSerializer of DRF, it returns "image_file": null.
I uploaded this issue on the DRF mongoengine forum.

Looks like mongoengine's ImageField doens't go well with DRF mongoengine's ImageField.
I don't know which one is problem.

This is the source code.

from rest_framework_mongoengine.serializers import DocumentSerializer
from ..models import *

class Detail_computer_Serializer(DocumentSerializer):
    class Meta:
        model = Item_Detail

from django_mongoengine import Document, EmbeddedDocument

class ItemDetail(Document):
    image_file = ImageField()

in Django view.py
def image_upload(request):
    item.image_file = request.FILES['image_file']
    ....

@jcodebrain
Copy link
Author

Same Issue : #847

@jcodebrain
Copy link
Author

same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant