In Django REST Framework, viewsets group the logic for a set of related API endpoints (the CRUD operations for a resource) into a single class, and routers automatically generate the URL routing for them. Together they dramatically reduce boilerplate for building RESTful APIs.
ModelViewSet — teljes CRUD néhány sorban
rest_framework viewsets
(viewsets.ModelViewSet):
queryset = Article.objects.()
serializer_class = ArticleSerializer
