0PricingLogin
Django Academy · Lesson

all(), get(), and filter()

The core ways to retrieve objects.

Meet the Manager

Every model gives you a free objects manager. It is your front door to the database, and every query you write starts from it. 🚪

Book.objects

Grab Everything

Call all() to ask for every row in the table. You get back a QuerySet you can loop over, count, or refine further.

books = Book.objects.all()

All lessons in this course

  1. all(), get(), and filter()
  2. Field Lookups and exclude()
  3. order_by, Slicing, and Lazy Evaluation
  4. values, values_list, and count
← Back to Django Academy