openwisp / django-rest-framework-gis

Geographic add-ons for Django REST Framework. Maintained by the OpenWISP Project.
http://openwisp.org
MIT License
1.07k stars 200 forks source link

Using GeoFeatureModelSerializer with files #278

Open hvitis opened 1 year ago

hvitis commented 1 year ago

Hello

I was wondering if there is a possibility / example of using GeoFeatureModelSerializer with a model that has an image field. I am trying to do it in a single request using

parser_classes = [MultiPartParser, JSONParser ]

It works with different models, there creation is easy and possible, retaining all fields passed plus the file.

Is it possible with the serializer above? What should be added / changed if so?