Skip to content

Performing actual queries in get_queryset method #42

@giulioindev

Description

@giulioindev

I need to call the following url: users/:user_pk/photos/:photo_pk/

To get only the photos related to the user having id=user_pk if the user exists, I have to extend the get_queryset method to be able to raise NotFound exception if no user with id=user_pk exists.

Which is the best way to manage it since I'm performing a query on the DB and the get_queryset method is only sync in GenericAPIView, GenericViewSet, etc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions