drf-nested-routers
drf-nested-routers copied to clipboard
Any plans for nested custom serializer with PrimaryKeyRelatedField?
Suppose I have following URLs, models, and viewsets:
An ArticleAPIViewSet, which handles:
/articles/articles/{slug}
And an CommentAPIViewSet, which handles:
/articles/{slug}/comments
With NestedHyperlinkedModelSerializer written and NestedViewSetMixin attached in my viewset, queryset such as:
Comments.objects.all()
would be automatically filtered with article_slug.
Is there any ways to automatically filter nested viewsets' queryset, or any plans to support those?
is there any workaround?