Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Review0:54 with Kenneth Love
Here we are at the end! All of these ORM functions will make you apps more powerful and more useful.
And that's it for Django ORM.
I know there are a ton of methods to remember and take advantage of.
But the good news is that you don't have to memorize them all.
Just keep the Django documentation handy and
whenever you find yourself needing to do something with your models,
scan through and see if Django gives you a way to do it.
It probably does.
After a few projects, you'll have all of the most useful and
common methods memorized.
I know that when I was first starting out as a web developer building CMS' with PHP,
I would've given an arm and a leg to have something like Django's system.
And I can't imagine building anything even remotely complicated without Django debug
If you're concerned about your query counts,
you can actually write tests using the assert num queries assertion.
And enforce that a particular view generates only say three queries total.
This isn't likely to be an assertion you use all the time.
But if you have a tricky area that sometimes gets out of hand on query
counts, it can be a real lifesaver.
Thanks for learning about Django's ORM with me.
I'll see you next time.
You need to sign up for Treehouse in order to download course files.Sign up