djangodocs.org

238 sections in Django 4.2 Search all versions →

strictly_below

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly below the lookup geometry’s bounding box. Example: PostGIS equivalent:

PostGIS

Reference GeoDjango Installation Platform-specific instructionsWindows

From within the Stack Builder (to run outside of the installer, Start ‣ PostgreSQL 15 ‣ Application Stack Builder), select PostgreSQL 15 (x64) on port 5432 from the drop down menu and click next.

include

Reference PostgreSQL specific database constraints ExclusionConstraint

ExclusionConstraint.include A list or tuple of the names of the fields to be included in the covering exclusion constraint as non-key columns.

TextField limitations

Reference Databases Oracle notes

The Oracle backend stores TextFields as NCLOB columns. Oracle imposes some limitations on the usage of such LOB columns in general: LOB columns may not be used as primary keys. LOB columns may not be used in indexes.

NullBooleanField

Reference Form fields Built-in Field classes

classNullBooleanField(**kwargs) : - Default widget: NullBooleanSelect - Empty value: None - Normalizes to: A Python True, False or None value. - Validates nothing (i.e., it never raises a ValidationError).

TypedChoiceField

Reference Form fields Built-in Field classes

classTypedChoiceField(**kwargs) : Just like a ChoiceField, except TypedChoiceField takes two extra arguments, coerce and empty_value.

include

Reference Constraints reference UniqueConstraint

UniqueConstraint.include A list or tuple of the names of the fields to be included in the covering unique index as non-key columns.

Raw SQL expressions

Reference Query Expressions Built-in Expressions

classRawSQL(sql,params,output_field=None) Sometimes database expressions can’t easily express a complex WHERE clause. In these edge cases, use the RawSQL expression.

include

Reference Model index reference Index options

Index.include A list or tuple of the names of the fields to be included in the covering index as non-key columns.

extra()

Reference QuerySet API reference QuerySet APIMethods that return new QuerySets

In this particular case, we’re exploiting the fact that the query will already contain the blog_blog table in its FROM clause.

AND (&)

Reference QuerySet API reference QuerySet APIOperators that return new QuerySets

Combines two QuerySets using the SQL AND operator in a manner similar to chaining filters. The following are equivalent: SQL equivalent:

OR (|)

Reference QuerySet API reference QuerySet APIOperators that return new QuerySets

Combines two QuerySets using the SQL OR operator. The following are equivalent: SQL equivalent: | is not a commutative operation, as different (though equivalent) queries may be generated.

XOR (^)

Reference QuerySet API reference QuerySet APIOperators that return new QuerySets

New in Django 4.1. Combines two QuerySets using the SQL XOR operator. The following are equivalent: SQL equivalent: NOTE: XOR is natively supported on MariaDB and MySQL. On other databases, > x ^ y ^ ...

count()

Reference QuerySet API reference QuerySet APIMethods that do not return QuerySets

count() acount() Asynchronous version: acount() Returns an integer representing the number of objects in the database matching the QuerySet.

exact

Reference QuerySet API reference QuerySet APIField lookups

Exact match. If the value provided for comparison is None, it will be interpreted as an SQL NULL (see isnull for more details).

iexact

Reference QuerySet API reference QuerySet APIField lookups

Case-insensitive exact match. If the value provided for comparison is None, it will be interpreted as an SQL NULL (see isnull for more details). Example: SQL equivalents: Note the first query will match 'Beatles Blog', 'beatles blog', 'BeAtLes BLoG', etc.

year

Reference QuerySet API reference QuerySet APIField lookups

For date and datetime fields, an exact year match. Allows chaining additional field lookups. Takes an integer year.

month

Reference QuerySet API reference QuerySet APIField lookups

For date and datetime fields, an exact month match. Allows chaining additional field lookups. Takes an integer 1 (January) through 12 (December).

day

Reference QuerySet API reference QuerySet APIField lookups

For date and datetime fields, an exact day match. Allows chaining additional field lookups. Takes an integer day.