Django Model Inheritance - Abstract Models and Multi-Table Inheritance

preview_player
Показать описание
This video will dive into 2 methods of model inheritance in Django.

1. Abstract Classes
2. Multi-Table Inheritance

Both approaches will be considered, and the effects on the underlying database examined.

▶️ Full Playlist:

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
01:16 Creating Quiz model
02:06 Creating Question abstract model
03:42 Creating subclasses for question types
06:16 Examining database structure
07:17 Querying models in shell
10:45 Multi-table inheritance
12:48 Querying in the shell

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:

#django #python
Рекомендации по теме
Комментарии
Автор

This is what I need for my project, I've been figuring out decent ways to avoid duplication of model content to each and every content I make in my project. Thanks you!

richardalcantara
Автор

An issue with Multiple Inheritance is that you can have a performance hiy if your database is too large, because in has to make joins for every query.

MagnusAnand
Автор

It would be cool if you could make a video about using composition in Django 💪

MagnusAnand
Автор

I used field created_at and updated_at in CommonField class and inherited but how do i make sure that the created_at and updated_at columns are at last of the table because when i inherited it, it comes at first of the table.

sarozpradhan
Автор

Hi Bugbytes, thanks for this new video. Can this model inheritance be used in product variation of an eccommerce? If yes, how?

fernandtape