Django ManyToManyFields and Through-Models for many-to-many relationships

Описание к видео Django ManyToManyFields and Through-Models for many-to-many relationships

In this video, we'll look at many-to-many relations in Django. We'll see how to add a ManyToManyField on a Django model, and how to use that field to query for related objects with the ManyRelatedManger and functions such as add(), remove(), all(), set() and clear().

We'll also look at junction tables in the database, created for many-to-many relationships, and will see how Django creates these implicitly, and how we can explicitly add extra data to these tables via through models.

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:36 ManyToManyField in Django
04:26 Junction Tables for ManyToManyFields in Django
06:27 Querying ManyToManyFields in Django
19:00 Customising ManyToManyFields with the through argument (through models)

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

▶️ Full Playlist:
   • Django ORM Deep Dive  

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

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Many-to-Many Relationships: https://docs.djangoproject.com/en/4.2...
Extra Fields on M2M Relationships: https://docs.djangoproject.com/en/4.2...
Associative Entity: https://en.wikipedia.org/wiki/Associa...

#python #django #webdevelopment #database #sql

Комментарии

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