Reference Widgets
classRadioSelect[source] : - template_name: 'django/forms/widgets/radio.html' - option_template_name: 'django/forms/widgets/radio_option.html'
477 sections across all versions Narrow to Django 6.0 (current) →
Reference Widgets
classRadioSelect[source] : - template_name: 'django/forms/widgets/radio.html' - option_template_name: 'django/forms/widgets/radio_option.html'
Reference Conditional Expressions
When a conditional expression returns a boolean value, it is possible to use it directly in filters.
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.
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.
Reference QuerySet API reference
Combines two QuerySets using the SQL AND operator in a manner similar to chaining filters. The following are equivalent: SQL equivalent:
Reference QuerySet API reference
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.
Reference QuerySet API reference
Combines two QuerySets using the SQL XOR operator. A XOR expression matches rows that are matched by an odd number of operands. The following are equivalent: SQL equivalent: NOTE: XOR is natively supported on MariaDB and MySQL.
Reference QuerySet API reference
count() acount() Asynchronous version: acount() Returns an integer representing the number of objects in the database matching the QuerySet.
Reference QuerySet API reference
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.
Reference QuerySet API reference
For date and datetime fields, an exact year match. Allows chaining additional field lookups. Takes an integer year.
Reference QuerySet API reference
For date and datetime fields, an exact month match. Allows chaining additional field lookups. Takes an integer 1 (January) through 12 (December).
Reference QuerySet API reference
For date and datetime fields, an exact day match. Allows chaining additional field lookups. Takes an integer day.
Reference QuerySet API reference
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
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
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
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
Case-insensitive regular expression match. Example: SQL equivalents:
Reference The Django template language: for Python programmers
The recommended way to create a Template is by calling the factory methods of the Engine: get_template(), select_template() and from_string(). In a Django project where the TEMPLATES setting defines a DjangoTemplates engine, it’s possible to instantiate a Template directly.
Topic guide Password management
Argon2 is the winner of the 2015 Password Hashing Competition, a community organized open competition to select a next generation hashing algorithm.
Topic guide Making queries
The QuerySet returned by all() describes all objects in the database table. Usually, though, you’ll need to select only a subset of the complete set of objects. To create such a subset, you refine the initial QuerySet, adding filter conditions.