You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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']
....
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: