Django OR query

preview_player
Показать описание
The Django ORM series covers a range of common functions that you will perform on a database with Django. In this tutorial we take a look at creating OR queries both in native Django statements and using Q objects. In addition we take a look at the SQL that powers the queries and look to see how we can see the performance of our queries.

00:00 Introduction
01:04 Setup Information
02:05 Install SQLite - optional
Lets start
02:45 How to run a simple query
10:29 Using the shell to run queries
OR query examples
13:00 OR query example
18:30 OR query example with Q objects

Code Repository

✨ Support us - join us as a very academy member

👍SUBSCRIBE to get more free tutorials, courses and code snippets!

👍👍Follow us on Facebook

👍👍👍Follow use on Twitter:
Рекомендации по теме
Комментарии
Автор

Thanks, just thanks! I really love and enjoy this channel. You're possibly the only creator with this quality level serving really in-depth knowledge about django. I Would love more videos regarding DRF and Deployment, and freecodecamp is also a great idea.

wannabedevo
Автор

I came here for Django ORM. Now I am Hooked to your channel.

heyrmi
Автор

you never fail to impress. i am implementing this django ORM SQL logic into my own project works amazing. thanks

chetty
Автор

your tutorials are NEXT LEVEL! keep up the great work!

oliver
Автор

you have solid knowledge which we can see through your videos and teaching method. just new to your channel. Subscribed and following for your next videos. for now following your other playlists to get more knowledge about Django <3

Thank you. more power to you.

djangodeveloper
Автор

Why isn't the or statement just returning the first query ??? Why is it returning both?

Ameyiscool
Автор

awesome. Everytime i watch your videos i will learn a new thing. Today i learned about sqlite extension in vscode. Previously about docker extension. Those are really very useful to explore data from vs code itself. Tq so much. You should definitely do a video on freecodecamp, so everyone will know about your awesome channnel. All the best :)

rangabharath
Автор

Great tutorial! I am using debug toolbar to show the detail of queries but have not idea where does that info come from. BTW django-extensions is also a good tool to enhance the Django shell by running python manage.py shell_plus, which will import all existed models, Q, F, aggregate, and many useful functions on your behalf when launched, and use an ipython shell, quite recommendable.

Oda
Автор

Like all your tutorials Gold value, thank you

tbaror
Автор

So for me print(connection.queries) returns an empty list what am I missing?

amjadsaleem
Автор

really enjoying your content. do have any plan doing django cache.

rajughorai
Автор

Any chance this can be updated to Django 4 as it has changed and this no longer works.

jhutchtor
Автор

How to find which importables can be imported from django.db?

samiulsalehin
Автор

sir, if I want to activate this query from the webpage, how will I do it? What would be the url?

shivaramsrikanth
Автор

print(connection.query) is returning as empty list. Any suggestion?

sanketnawale
Автор

Hello bro i have written code : "print(connections.queries) " but it print empty list what i have to do

vamsikrishnaaliveli
Автор

Which version of Django are you using?

biplob
Автор

how to get an option to open database in pycharm?

akshattrivedi
Автор

QUESTION: What's the benefit of using a Q object???

MagnusAnand