Consider a simple view:
class SomeView(viewsets.GenericViewSet, viewsets.mixins.ListModelMixin, viewsets.mixins.RetrieveModelMixin): ... @decorators.detail_route(methods=ENDPOINT_PROPERTY_METHODS) def some_property(self, request, *args, **kwargs): view = SomeOtherView return view.as_view(CRUD_ACTIONS)(request, *args, **kwargs)
I'm calling SomeOtherView to be able to have an endpoint property, like /someresource/:id/myproperty , so this property will receive a request and can do all CRUD actions.
But I want SomeOtherView have a declared detail_route inside too, to have something like /someresource/:id/myproperty/nestedproperty .
Since I call SomeOtherView dynamically, URLs cannot be registered, so the attached property cannot be called.
How can I resolve this situation to have nested properties?
source share