StaffCoder
Django
DjangoDjango 5.2Python 3.13
18 modules · 72 challengesSign up
Modules18 modules · 72 challenges
Query the database through the ORM: filter, order, shape results, and fetch single objects safely in one query.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Filtered Product Lookups

Sign up to unlock
100%5 of 5 solvedeasy
About this challenge

The product search returns everything no matter what the user asks for. Filter products by a case-insensitive name match and an inclusive price range, leave out inactive items, sort by price then name, and answer in a single database query.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Ordered Result Shaping

Sign up to unlock
100%4 of 4 solvedeasy
About this challenge

A report needs items in the right order, only a few columns, and just the latest rows. Add chainable QuerySet methods that sort by name or newest first, take the top N, and return plain dicts or a flat list of names.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Single Object Retrieval

Sign up to unlock
75%3 of 4 solvedeasy
About this challenge

Detail lookups crash on unknown products and silently pick a random row when names repeat. Fetch single products safely by sku and by name, ignore discontinued items, and answer "any products?" and "how many?" without loading rows.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Catalog Query Toolbox

STAR
Solving it completes the module
100%3 of 3 solvedeasy
About this challenge

Support needs one set of catalog answers they can trust. Build query functions for search, newest items, price lists, name lists and single lookups, each skipping inactive products and running exactly one query.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.