Django - F Expressions for database-level operations

preview_player
Показать описание
This video looks at F Expressions in Django, which can be used to generate SQL expressions that describe the required operation at the database level. For example, F Expressions can be used to filter QuerySets with a condition that compares one column's value to another column's value at the database level.

F Expressions can be used when:
- updating date with update()
- filtering data with filter() and exclude()
- annotating data with annotate()
- aggregating data with aggregate()

And more!

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:30 F Expressions in Django
11:00 F Expressions in filter() functions to compare with other column values
13:03 F Expressions in Django annotate() function
15:32 F Expressions in Django aggregate() function
17:48 refresh_from_db() function in Django

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

▶️ Full Playlist:

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

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

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

I can feel a great understanding of Django from your end. I always look for your videos first for any concept. Perfectly understood, thanks 👍👍

el.wan_x
Автор

The F class well explained and understood now 😁, thank you Master 🙌🏾.

seydinaoumarsamabaly
Автор

It is brilliant explain for stupid me. Thx so much

acb
Автор

Man You are a life saver. Thank you very much for these series. Subscribed liked. Keep up the good work, enabled the notification.

shahabgohar
Автор

What is the difference between following. Why should I use annotate



Most importantly, Sir you are doing a Gr8 work.

munirhakani
Автор

The videos are quite clear in terms of the functionality you are trying to present, but I think sometimes we dont have that much of experience with SQL, so you should not comment the connection.queries print statement, because we want to see how each query runs.
We could also do it while practicing, but it would be great if you could keep it enabled for most of the time, in case we want to see what is happening behind the scenes.

rns
Автор

Really, It is one of the best Channel over the YouTube for Django ORM.
Thank You so much for this knowledge. ☺☺

Geeky_gamer
Автор

Great video. Would love to see you cover Django and APScheduler at some point!

qhqlfsf
Автор

Thank you for sharing your knowledge good Sir.

juanbetancourt
Автор

When running prefetch and select related, how do we get back products.promo.price rather than products__promo__price? The first method allows me to reuse templates rather than having to go into templates and add the dunder to every occurrence

Septumsempra