Django Model Inheritance - Abstract Models and Multi-Table Inheritance

  Рет қаралды 4,548

BugBytes

BugBytes

Күн бұрын

Пікірлер: 19
@richardalcantara3495
@richardalcantara3495 2 жыл бұрын
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!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Nice one, thank you for the comment!
@stevepole1970
@stevepole1970 2 жыл бұрын
Beautifully explained. Well done.
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you very much!
@alaminbijoy1027
@alaminbijoy1027 2 жыл бұрын
thanks man. Learned something new.
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Nice one man, thanks for commenting!
@danielcallaghan6892
@danielcallaghan6892 2 жыл бұрын
aweome, very clear!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you!
@DemelashShimekit
@DemelashShimekit 6 ай бұрын
Thank you
@bugbytes3923
@bugbytes3923 6 ай бұрын
Thanks for watching!
@chaseeby100
@chaseeby100 Жыл бұрын
Thank you!
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot for watching!
@sarozpradhan64
@sarozpradhan64 Жыл бұрын
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.
@fernandtape9363
@fernandtape9363 2 жыл бұрын
Hi Bugbytes, thanks for this new video. Can this model inheritance be used in product variation of an eccommerce? If yes, how?
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks for commenting. Yes, you may have multiple different types of products, each with their own fields. But there may be a common set of fields that you can define on a base class (this could be an abstract model, or you could go with the multi-table inheritance approach). For example, all products would have a "price", so it makes sense to use this on a base class. But certain products may have different, specific fields. A clothing product may have fields such as "size", whereas a food/drink product may have fields such as "calories". These would belong in the subclasses. I hope that makes sense!
@MagnusAnand
@MagnusAnand 2 жыл бұрын
It would be cool if you could make a video about using composition in Django 💪
@MagnusAnand
@MagnusAnand Жыл бұрын
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.
@truthdawn7773
@truthdawn7773 2 жыл бұрын
❤️👌
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks! 😄
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Python Django Inheritance Optimisation Exercise
52:56
Very Academy
Рет қаралды 13 М.
Django Conditional Expressions / Case() and When() objects
36:26
Which Database Model to Choose?
24:38
High-Performance Programming
Рет қаралды 67 М.
What are Django class based views & should you use them?
36:19
Dennis Ivy
Рет қаралды 84 М.