rpkilby / dj-jsonapi

A JSON-API server implementation built for Django on top of Django Rest Framework
Other
0 stars 1 forks source link

Test polymorphic relationships #29

Open rpkilby opened 8 years ago

rpkilby commented 8 years ago

When getting a related queryset, we combine the object's related queryset with the view's queryset. This ensures that any filtering on the viewset is also applied to the related viewset. These kinds of checks (with django-model-utils, maybe django-polymorphic) need to be tested.

This is a little harder to do with to-one relationships, since you can't intersect the queryset with a single instance. This requires getting the object, and refetching it with the viewset's queryset.