Can I set viewpoints and create routes that accept pkas URL parameters?
primarily
class TaskView(viewsets.ModelViewSet):
model = Task
this works fine and maps to the url task/, so it task/1/provides task data with identifier 1. Now I want to create instancetasks with CRUD operations, just like for a task, so I would like to have
class InstanceView(viewsets.ModelViewSet):
model = Instance
maps to task/{pk}/instance, where pkis the task identifier.
How can i do this? Is it possible? PS: I have seen that there is @actionand @link, but using them, I lose because of the presence of all that made frame.
source
share