estebistec / drf-compound-fields

Django-REST-framework serializer fields for compound types.
BSD 3-Clause "New" or "Revised" License
92 stars 12 forks source link

Doesn't work for `RelatedField` and subclasses. #25

Open mrmachine opened 9 years ago

mrmachine commented 9 years ago

The isinstance(..., list) check fails on queryset/manager values and so the repr of the queryset/manager object is displayed as a single object instead of showing a list of objects.

The advice is probably to just use RelatedField, but the reason for wanting to use ListOrItemField is to allow older API clients which are expecting to set and get a single value to do so without making any changes.

estebistec commented 9 years ago

Please see #27

mrmachine commented 9 years ago

We are not using DRF3 in our project. Are you saying that this issue would only be fixed in an updated version of DRF-compound-fields that works with DRF3?

estebistec commented 9 years ago

Given my limited amount of time, DRF3 is at least where I'm solving these problems first. Of course I'll keep a maintenance branch open to accept pull requests on for DRF2.X fixes.