Django Conditional Expressions / Case() and When() objects

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

BugBytes

BugBytes

Күн бұрын

In this video, we'll show examples of how to perform Conditional Expressions in Django.
These allow developers to perform IF/ELSE logic within database queries, and get back values based on conditions that are defined using Case and When objects.
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugb...
▶️ Full Playlist:
• Django ORM Deep Dive
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: bugbytes.io/po...
👾 Github: github.com/bug...
🐦 Twitter: / bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Django Conditional Expressions: docs.djangopro...
#python #django #webdevelopment #database #sql

Пікірлер: 43
@bugbytes3923
@bugbytes3923 10 ай бұрын
ORM Playlist link: kzbin.info/www/bejne/e6SlonyQordli8U
@trosgate
@trosgate Жыл бұрын
I will be deceiving myself if I don't drop a comment on this. These are advanced topics littered in few books. You have simplified everything.❤
@bugbytes3923
@bugbytes3923 Жыл бұрын
Awesome - thanks a lot for the nice comment!
@alexisrichard1812
@alexisrichard1812 5 ай бұрын
Perfect. Simple, clear and well explained. Continue this way. I do not raise very often comment but as previously said by others, it is really great videos on ORM. Many thanks for your time and dedication. You should think about posting training on udemy or others sites, I will definitively support you.
@bugbytes3923
@bugbytes3923 5 ай бұрын
Thanks a lot! Appreciate the nice comment, I'll maybe try releasing some full courses after new year I think. Thanks again!
@juanbetancourt5106
@juanbetancourt5106 Жыл бұрын
I use to use Pandas for that type of data analysis but the orm seems like a robust way to handle the same logic, thank your good Sr.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks - Pandas is always good too, but definitely a heavier dependency in a web app!
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 Жыл бұрын
I knew these concepts from SQL, now in Django Orm 😀. Thank you very much Master 🙌🏾.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot!
@DecodingTruth101
@DecodingTruth101 Ай бұрын
amazing content ,great tutor
@bugbytes3923
@bugbytes3923 Ай бұрын
Thanks so much!
@DjangoNator
@DjangoNator Жыл бұрын
man u actually a hero
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot, glad to hear that!
@anatoliyloboda4601
@anatoliyloboda4601 11 ай бұрын
Thanks for good explanation! Even though it looks a little complicated, for me it is amazing. I will be poud if I could to write such a comprehensive code!
@bugbytes3923
@bugbytes3923 11 ай бұрын
Thanks a lot! Appreciate it! And yes, it's a little complex, and not something you'd use every day as a Django dev. Useful to know, though!
@Developer_python_
@Developer_python_ Ай бұрын
Very useful lesson
@bugbytes3923
@bugbytes3923 Ай бұрын
@@Developer_python_ thank you 🙏
@uttamsharma3242
@uttamsharma3242 8 ай бұрын
Well explanation, Thank you so much
@bugbytes3923
@bugbytes3923 8 ай бұрын
Thanks a lot!
@oizik
@oizik Жыл бұрын
Brilliant content, thank you so much!
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot!
@repotranstech
@repotranstech Жыл бұрын
Great video as always.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot!
@jonathacarneiro
@jonathacarneiro Жыл бұрын
amazing content, congratulations!
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot for watching and commenting, cheers!
@khalilbenmeziane8836
@khalilbenmeziane8836 Жыл бұрын
great teacher 🌹
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot!
@miguelvasquez9849
@miguelvasquez9849 Жыл бұрын
it helps me a lot, thanks
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks, great to hear that!
@alexdubkov6998
@alexdubkov6998 Жыл бұрын
Super!
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thank you!
@hack727
@hack727 10 ай бұрын
Great content, plz make a video on django signals.
@bugbytes3923
@bugbytes3923 10 ай бұрын
Will do! Coming up soon...
@imanirban
@imanirban Жыл бұрын
hello?... I'm working with a HTMX file upload form, I want to have a cancel button, on click, the post request will be cancelled, how do I cancel it?...
@khunjohn1054
@khunjohn1054 Жыл бұрын
THIS ... WAS ... AWESOME. I've yet to use the case and when structures so was. More advanced topics are welcome. Here's an idea/challenge I was mulling over the other day in regards to Django vs FastApi. Everyone wants fast, modern and async, but I won't give up on the orm or the migrations. Yes I can use SQLAlchemy and Alembic, but it doesn't have the same sleekness. Can you get the same speed and lightness in Django by using Daphne/Uvicorn ASGI, the async ORM functions, and async functions using Django-Nina as the serializer? I'm not sure if ninja has implemented pydantic 2.0 yet, but their first full release is in beta 1.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks! And interesting idea there - I'll need to revisit django-ninja. Some of my earliest videos where I actually put more thought into the planning were on Ninja, but I'm not sure if it supports Pydantic 2.0 yet.
@frameff9073
@frameff9073 Жыл бұрын
thank you
@bugbytes3923
@bugbytes3923 Жыл бұрын
Thanks a lot!
@shahabgohar3350
@shahabgohar3350 8 ай бұрын
Majestic
@myoji5580
@myoji5580 Жыл бұрын
I watched your videos many times. Very thanks. I just talked program bug. Not offensive. I don’t understand why delete my comment.
@bugbytes3923
@bugbytes3923 Жыл бұрын
Please post the bug here! KZbin must have deleted that comment (this happens a lot!). Thanks for watching!
@myoji5580
@myoji5580 Жыл бұрын
This code have a bug If last_sale: 2023-08-03 dates last date range: 2023-07-30 ~ 2023-08-09 But last sale: 2023-08-03 Right dates last date range: 2023-07-30 ~ 2023-08-03(03? 04?) Additionally, Filtering a DateTimeField with dates won’t include items on the last day, because the bounds are interpreted as “0am on the given date”. If pub_date was a DateTimeField, the above expression would be turned into this SQL: SELECT ... WHERE pub_date BETWEEN '2005-01-01 00:00:00' and '2005-03-31 00:00:00'; Thanks lecture!😊 Delete Django link. I think link problem
@dmitrymikhailovnicepianomu8688
@dmitrymikhailovnicepianomu8688 Жыл бұрын
Not easy to grasp!
Django - select_for_update() function / Locking Database Rows
23:36
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Errors propagation (using Result type) vs exceptions
3:53
Beyond TypeScript
Рет қаралды 1,4 М.
Django Database Transactions / atomic() function
34:15
BugBytes
Рет қаралды 7 М.
10 ULTIMATE Python Tips 🔥
16:42
Tech With Tim
Рет қаралды 75 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН