Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Django ORM Course

via Treehouse

This course may be unavailable.

Overview

Django has a very powerful ORM that provides us a huge amount of convenience when building our apps. In this course, we'll learn about and use many of the methods and tools that Django gives us including ordering results, selecting only certain attributes, excluding results that match a particular value, and more,

What you'll learn

  • Filter and exclude methods
  • F and Q objects
  • django-debug-toolbar
  • CRUD methods
  • Annotations and aggregations

Syllabus

Same Old ORM

We've used the ORM in all of our previous Django courses but we haven't explored it very much. Before we start with the exploring, let's do a little review of the ORM's major points.

Chevron 5 steps
  • Let's Review!

    2:06

  • Model Upgrades

    4:47

  • Create the review model

    3 objectives

  • django-debug-toolbar

    8:23

  • ORM Review

    5 questions

Basic ORM Usage

We know where we stand, so let's start looking at how to use this amazing tool. We'll see how to get just the results we want; create, update, and delete results; and control what all information we're given.

Chevron 10 steps
  • Restricting Results

    6:02

  • Filter

    1 objective

  • Exclusivity

    6:53

  • Exclude

    2 objectives

  • Updates and Deletes

    6:59

  • Delete

    1 objective

  • The Miracle of Creation

    5:17

  • Bulk create

    1 objective

  • Take Control

    8:26

  • Ordering

    1 objective

Total Control

Now that we can get records pretty much anyway we want, let's see about adding more control to our queries, more information to our results, and creating better queries all together.

Chevron 12 steps
  • Brought to You by the Letter F

    6:59

  • F objects

    1 objective

  • Mind your Ps and Qs

    5:32

  • Q

    1 objective

  • Aggregate and Annotate

    6:32

  • Annotate

    1 objective

  • Aggregate

    1 objective

  • Related Records

    9:49

  • prefetch_related

    2 objectives

  • select_related

    1 objective

  • Review

    0:54

  • Review: Django ORM

    10 questions

Reviews

Start your review of Django ORM Course

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.