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

GeoFeatureModelSerializer and QueryFieldsMixin #280

Open jmpmcmanus opened 1 year ago

jmpmcmanus commented 1 year ago

I'm trying to use GeoFeatureModelSerializer, along with QueryFieldsMixin from djangorestframework-queryfields as follows:

class gauge_station_source_data_Serializer(QueryFieldsMixin, GeoFeatureModelSerializer):

However, when I specify ?fields=field1,field2 in my url, it still returns all the fields available, instead of just field1 and field2.

I can use QueryFieldsMixin without GeoFeatureModelSerializer, on a none geospatial model, and it works fine.

Jim