Тёмный
No video :(

Django Model Inheritance - Abstract Models and Multi-Table Inheritance 

BugBytes
Подписаться 30 тыс.
Просмотров 4,1 тыс.
50% 1

Опубликовано:

 

4 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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!
@DemelashShimekit
@DemelashShimekit 2 месяца назад
Thank you
@bugbytes3923
@bugbytes3923 2 месяца назад
Thanks for watching!
@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!
@chaseeby100
@chaseeby100 8 месяцев назад
Thank you!
@bugbytes3923
@bugbytes3923 8 месяцев назад
Thanks a lot for watching!
@danielcallaghan6892
@danielcallaghan6892 2 года назад
aweome, very clear!
@bugbytes3923
@bugbytes3923 2 года назад
Thank you!
@MagnusAnand
@MagnusAnand 10 месяцев назад
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
@MagnusAnand Год назад
It would be cool if you could make a video about using composition in Django 💪
@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!
@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.
@truthdawn7773
@truthdawn7773 2 года назад
❤️👌
@bugbytes3923
@bugbytes3923 2 года назад
Thanks! 😄
Далее
Mixins in Python
6:11
Просмотров 20 тыс.
Django 5.0 Just Made Forms Even Better
3:24
Просмотров 11 тыс.
Django - F Expressions for database-level operations
20:36
Django-Unicorn - Building a Shopping Cart Component
27:17
Python Django Inheritance Optimisation Exercise
52:56