Field note
What it does
Django's database abstraction layer for defining models and querying relational data.
Capabilities
Available capabilities
Tags
Tags
Ways to use it
Ways to use it
Python / Django
Django's database abstraction layer for defining models and querying relational data.
Field note
Django's database abstraction layer for defining models and querying relational data.
Capabilities
Tags
Ways to use it
Python / Django
Product features
Terminal clause returning a dictionary of computed aggregate values over a QuerySet.
Avg, Max, Min, Count and other functions from django.db.models.
Generates an aggregate for each item in a QuerySet as an attribute.
Create a block of code guaranteeing atomicity; usable as decorator or context manager, nestable.
Wraps each request in a transaction; commits on success, rolls back on exception.
Create or update many rows in bulk.
Provide a default returned instead of None when no rows exist.
Control which fields are loaded from the database.
Returns a context manager that installs a wrapper around database query executions on the thread-local connection.
Shows how the database executes a query, including indexes and joins.
Do filtering and aggregation work in the database.
Count with filter=Q(...) to aggregate a subset of related rows.
Reduces memory use when iterating over many objects.
Model relationship API usage examples for many-to-many relationships.
Model relationship API usage examples for many-to-one relationships.
A model is the single, definitive source of information about your data.
Decorator that negates the effect of ATOMIC_REQUESTS for a given view.
Model relationship API usage examples for one-to-one relationships.
Add explicit SQL to queries when ORM expressions are insufficient.
Efficiently retrieve related objects in fewer queries.
Retrieve only needed fields instead of full model instances.
Wrappers receive execute, sql, params, many, and context arguments for each query execution.