ViewSets
A ViewSet replaces get/post handlers with action methods — list, retrieve, create, update, partial_update, destroy — bound to HTTP methods at URL-binding time, so one class serves both the collection and detail endpoints. The @action decorator adds custom routes, and ModelViewSet composes all CRUD mixins over GenericViewSet.
This Concept is waiting for its first lesson!
A ViewSet replaces get/post handlers with action methods — list, retrieve, create, update, partial_update, destroy — bound to HTTP methods at URL-binding time, so one class serves both the collection and detail endpoints. The @action decorator adds custom routes, and ModelViewSet composes all CRUD mixins over GenericViewSet.
Are you a teacher? Sign in to start contributing.
Sign In