Custom Calculation In DRF | Django Rest Framework

Описание к видео Custom Calculation In DRF | Django Rest Framework

Django REST Framework Views - ViewSets:
Up to this point, we've covered creating separate views with APIViews and Generic Views. Often, it makes sense to combine the view logic for a set of related views into a single class. This can be accomplished in Django REST Framework (DRF) by extending one of the ViewSet classes.

ViewSet classes remove the need for additional lines of code and, when coupled with routers, help keep your URLs consistent.

--

Django REST Framework Views Series:

APIViews
Generic Views
ViewSets (this article!)

ViewSets

ViewSet is a type of class-based view.

Instead of method handlers, like .get() and .post(), it provides actions, like .list() and .create().

The most significant advantage of ViewSets is that the URL construction is handled automatically (with a router class). This helps with the consistency of the URL conventions across your API and minimizes the amount of code you need to write.

There are four types of ViewSets, from the most basic to the most powerful:

ViewSet
GenericViewSet
ReadOnlyModelViewSet
ModelViewSet

They're mostly built out of the classes you got to know in the previous article in this series:
ViewSet Class

The ViewSet class takes advantage of the APIView class. It doesn't provide any actions by default, but you can use it to create your own set of views:

Keywords:
Django Rest Framework API #21 / Building Custom User Model
Add custom Data validator in Serliazer Django Rest framework | Django rest advance tutorial
3 Custom Calculation | Django Rest Framework
Custom Permission in Django REST Framework (Hindi)
🔥 Ultimate Django Rest API Course in Hindi | Rest APIS using Django in one shot
Django Rest Framework API #31 / Improve API Response Using Pagination
Custom Authentication in Django REST Framework (Hindi)
Django REST Framework (Hindi)

Hashtags:
#codeFast #this_is_coding_zone #code_like_pro #being_coder #beingCoder #django #python #djangounchained #programming #quentintarantino #coding #javascript #programmer #tarantino #leonardodicaprio #java #html #machinelearning #webdevelopment #pythonprogramming #php #css #pulpfiction #github #djan #killbill #onceuponatimeinhollywood #developer #movie #code #jamiefoxx #pythoncode #cinema #film #reservoirdogs

Комментарии

Информация по комментариям в разработке