drf-nested-routers icon indicating copy to clipboard operation
drf-nested-routers copied to clipboard

Any plans for nested custom serializer with PrimaryKeyRelatedField?

Open joeyworld opened this issue 6 years ago • 1 comments

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?

joeyworld avatar Oct 29 '18 11:10 joeyworld

is there any workaround?

sknmk avatar Aug 19 '21 12:08 sknmk