Reference QuerySet API reference QuerySet APIField lookups
For date and datetime fields, return the week number (1-52 or 53) according to ISO-8601, i.e., weeks start on a Monday and the first week contains the year’s first Thursday.
743 sections across all versions Narrow to Django 6.0 (current) →
Reference QuerySet API reference QuerySet APIField lookups
For date and datetime fields, return the week number (1-52 or 53) according to ISO-8601, i.e., weeks start on a Monday and the first week contains the year’s first Thursday.
Reference QuerySet API reference QuerySet APIField lookups
For date and datetime fields, a ‘day of the week’ match. Allows chaining additional field lookups. Takes an integer value representing the day of week from 1 (Sunday) to 7 (Saturday).
Reference QuerySet API reference QuerySet APIField lookups
For date and datetime fields, an exact ISO 8601 day of the week match. Allows chaining additional field lookups. Takes an integer value representing the day of the week from 1 (Monday) to 7 (Sunday).
Reference QuerySet API reference QuerySet APIField lookups
For date and datetime fields, a ‘quarter of the year’ match. Allows chaining additional field lookups. Takes an integer value between 1 and 4 representing the quarter of the year.
Reference QuerySet API reference QuerySet APIField lookups
For datetime fields, casts the value as time. Allows chaining additional field lookups. Takes a datetime.time value.
Reference QuerySet API reference QuerySet APIField lookups
For datetime and time fields, an exact hour match. Allows chaining additional field lookups. Takes an integer between 0 and 23.
Reference QuerySet API reference QuerySet APIField lookups
For datetime and time fields, an exact minute match. Allows chaining additional field lookups. Takes an integer between 0 and 59.
Reference QuerySet API reference QuerySet APIField lookups
For datetime and time fields, an exact second match. Allows chaining additional field lookups. Takes an integer between 0 and 59.
Reference QuerySet API reference QuerySet APIField lookups
Takes either True or False, which correspond to SQL queries of IS NULL and IS NOT NULL, respectively. Example: SQL equivalent:
Reference QuerySet API reference QuerySet APIField lookups
Case-sensitive regular expression match. The regular expression syntax is that of the database backend in use.
Reference QuerySet API reference QuerySet APIField lookups
Case-insensitive regular expression match. Example: SQL equivalents:
Reference QuerySet API reference QuerySet APIAggregation functions
Strings that reference fields on the model, transforms of the field, or query expressions.
Reference QuerySet API reference QuerySet APIAggregation functions
An optional argument that represents the model field of the return value NOTE: When combining multiple field types, Django can only determine the > output_field if all fields are of the same type.
Reference QuerySet API reference QuerySet APIAggregation functions
An optional Q object that’s used to filter the rows that are aggregated. See Conditional aggregation and Filtering on annotations for example usage.
Reference QuerySet API reference QuerySet APIAggregation functions
Keyword arguments that can provide extra context for the SQL generated by the aggregate.
Reference QuerySet API reference QuerySet APIAggregation functions
classBitAnd(expression,filter=None,default=None,**extra)[source] : > New in Django 6.1.
Reference QuerySet API reference QuerySet APIAggregation functions
classBitOr(expression,filter=None,default=None,**extra)[source] : > New in Django 6.1.
Reference QuerySet API reference QuerySet APIAggregation functions
classBitXor(expression,filter=None,default=None,**extra)[source] : > New in Django 6.1.
Reference QuerySet API reference QuerySet APIAggregation functions
classCount(expression,distinct=False,filter=None,**extra)[source] : Returns the number of objects that are related through the provided expression. Count('*') is equivalent to the SQL COUNT(*) expression.
Reference QuerySet API reference
This section provides reference material for query-related tools not documented elsewhere.