I use generics and simple URLs for my REST API, but now I run into a problem: I want user actions, simple representations to do some things with my models, for example "run", "publish", etc.
ViewSet provides an action decorator for creating custom actions, but only ViewSets also have power routers, which allows us to simplify everything using railsish convention-over-configuration.
But I find that ModelViewSet gives us the same capabilities as generics: full CRUD, serializers, filters, cusstom pre / post and queryset, so it leads to the question:
Why do generics exist if ModelViewSet gives the same ability and more? What's the difference?
python rest django django-rest-framework
dt0xff
source share