-
Hi, One solution is to override I tried to create metaclass that would do this combining, like this # views.py
class MyCombinedViewSet(
MyOwnerActionsViewSet,
MyReadViewSet, .....
metaclass=CombinedViewSetMetaclass
):
pass
# urls.py
router.register(r"my-api", MyCombinedViewSet, "my-api") I have somewhat working version, but now I hit a bump with correctly creating as_view()/dispatch() and started thinking that in the end it may be bad idea. What are your thoughts? How bad idea is it? More usecases:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
you can do it in your project or in a separate package. DRF do not intend to start new patterns at the stage of it lifecycle. |
Beta Was this translation helpful? Give feedback.
-
Feedback... I'm not actually all that keen on ViewSet full stop. I think they make for really unclear code, and were arguably a mistake. So, for my part, no I don't think it's likely to be a fantastic approach. |
Beta Was this translation helpful? Give feedback.
you can do it in your project or in a separate package. DRF do not intend to start new patterns at the stage of it lifecycle.