Creating Nested Objects | Overriding serializer create() method in Django REST Framework

Описание к видео Creating Nested Objects | Overriding serializer create() method in Django REST Framework

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes

⭐Top resource to learn Python - https://datacamp.pxf.io/kOjKkV ⭐

In this video, we'll learn how to create nested / related objects when sending POST/PUT requests in Django REST Framework. We'll show how to override the create() method on serializers, and how to dynamically pass data into serializers in generic views/viewsets.

Starter Code: https://github.com/bugbytes-io/drf-co...

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:45 Writing nested data in DRF overview
05:16 Creating serializer for Orders and OrderItems (POST requests)
08:40 Overriding get_serializer_class() to change serializer for POST requests
10:31 Overriding serializer create() method for nested data
16:56 Automatically setting user on POST requests

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/drf-co...
🐦 Twitter:   / bugbytesio  

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
DRF Serializers: https://www.django-rest-framework.org...
Classy DRF: https://www.cdrf.co/

#python #django #webdevelopment #djangorestframework

Комментарии

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