Django ORM - Querying and Creating Records / Working with Foreign Keys

preview_player
Показать описание
In this video, we'll cover ways to query databases with the Django ORM, and ways to create data with the ORM.

We'll look at a number of techniques, including the following methods:

We'll also look at how to create and query Foreign Key relations in Django.

▶️ Full Playlist:

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:55 django-extensions runscript command
02:21 Creating records by instantiating and saving Django models
07:07 Querying Data - Getting All Rows From a Table
11:05 Indexing into Django QuerySets
15:15 Querying Foreign Keys in Django
22:16 Updating existing records with model save() method
24:37 Querying related records in Django ORM
26:20 Querying reverse relations in Django

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

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

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

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

this is literally the best Django Channel there is, keep up the good work Lyle it will definitely get much bigger.

anouarbagent
Автор

showing sql was great, it gives idea of what queries is being executed, keep doing it.

hiankitkr
Автор

great. I don't think anybody explaining these things in django. most just touch the basic things. super helpful. just keep on doing.. . hope you also spend enough time on authentication and show custom user models in future.

sidds
Автор

I don't get any channel regarding django orm since past few months but got an exciting series from heaven thank u❤❤❤❤

rajeshyadav
Автор

It's always good to have you here. Thanks very much for the insights you've been given.

AmoahDevLabs
Автор

So simple, so easy to learn with you master 🙌🏾. Thank you.

seydinaoumarsamabaly
Автор

Thank you so much for this tutorial and of course very interested in this content and please continue in this very format there's very little internet content on the same. Excellent stuff

Davidkiania
Автор

This is a great tutorial about querying the database with Django! 🙏😀👍
I like that you show the under-the-hood SQL queries sometimes (and not too much).

And as pprint alternative: the rich and django-rich libraries are great for pretty printing stuff to the terminal too.

silkogelman
Автор

As always, great, high level, and detailed videos. Thank you so much.💪

Ego_Maritm
Автор

Please keep going with this series. Like from me on every single video here. This is amazing.

LegionLeague
Автор

I haven't seen the video yet. But I am grateful that you are putting such videos out.

iiju
Автор

Excellent video series so far. A bit fast but that keeps you focused. Not exactly for people with a moder super short attention span. Thank You so much for putting this together, learning a lot.

carstenthies
Автор

another excellent video! Channel is probably the best for Django and related subjects.

iwswordpress
Автор

Thanks Alot... You are my Django Mentor

ffzz
Автор

Very Great content, Just keep doing the queries explanation and Thank you

ytouate
Автор

I see you’ve reviewed django-hijack. Have a look at Django-unfold too

nicenaija
Автор

Awesome video 💪 plz Also make video on django subquery

SOHAILKHAN-iufu
Автор

Go on, if you make a complete course on Django for beginners it will be very useful and it will be a unique explanation

ammaryasser
Автор

Thank you, 3 lessons in and already better than paid udemy orm course, straight to the point without losing time on theory. Is there an option to pay something in order to suggest, and you maybe take into consideration to create a video on that subject?

TomislavMiletic
Автор

i think we shouldn't use get_or_create for user rating beacuse if user previously gave 5 star to a restaurant and now it's dissatisfied and want to give 2 stars then get_or_create will not be able to find the 5star rating of the user and will create another record in Ratings table with 2 star rating and it will lead to duplicates in rating unless user field is defined as unique
thank you so much for your effort, great series

JustPro