Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the nested routing to work after reading the docs. #338

Open
Aryan3212 opened this issue Sep 24, 2023 · 0 comments
Open

Can't get the nested routing to work after reading the docs. #338

Aryan3212 opened this issue Sep 24, 2023 · 0 comments

Comments

@Aryan3212
Copy link

Nested routes

In the doc, in this section it says to create views like this but won't I need a queryset or get_queryset()defined here? Just want to understand what's happening here. I found a workaround in another issue posted here to use self.filter_queryset_by_parents_lookups.

 yourapp.views
from rest_framework_extensions.mixins import NestedViewSetMixin

class UserViewSet(NestedViewSetMixin, ModelViewSet):
    model = UserModel

class GroupViewSet(NestedViewSetMixin, ModelViewSet):
    model = GroupModel

class PermissionViewSet(NestedViewSetMixin, ModelViewSet):
    model = PermissionModel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant