Reference Databases
SQLite does not support the SELECT ... FOR UPDATE syntax. Calling it will have no effect.
1413 sections across all versions Narrow to Django 6.0 (current) →
Reference Databases
SQLite does not support the SELECT ... FOR UPDATE syntax. Calling it will have no effect.
Reference
This document describes the details of the QuerySet API. It builds on the material presented in the model and database query guides, so you’ll probably want to read and understand those documents before reading this one.
Reference QuerySet API reference
Internally, a QuerySet can be constructed, filtered, sliced, and generally passed around without actually hitting the database. No database activity actually occurs until you do something to evaluate the queryset. You can evaluate a QuerySet in the following ways: Iteration.
Reference QuerySet API reference
If you pickle a QuerySet, this will force all the results to be loaded into memory prior to pickling.
Reference QuerySet API reference
Here’s the formal declaration of a QuerySet: classQuerySet(model=None,query=None,using=None,hints=None)[source] : Usually when you’ll interact with a QuerySet you’ll use it by chaining filters. To make this work, most QuerySet methods return new querysets.
Reference QuerySet API reference
Django provides a range of QuerySet refinement methods that modify either the types of results returned by the QuerySet or the way its SQL query is executed.
Reference QuerySet API reference
Combined querysets must use the same model.
Reference QuerySet API reference
The following QuerySet methods evaluate the QuerySet and return something other than a QuerySet. These methods do not use a cache (see Caching and QuerySets). Rather, they query the database each time they’re called.
Reference QuerySet API reference
Chaining order_by() with update() is supported only on MariaDB and MySQL, and is ignored for different databases. This is useful for updating a unique field in the order that is specified without conflicts.
Topic guide Models
There is no way to have Django return, say, a MyPerson object whenever you query for Person objects. A queryset for Person objects will return those types of objects.
Topic guide Making queries
QuerySet objects are lazy – the act of creating a QuerySet doesn’t involve any database activity. You can stack filters together all day long, and Django won’t actually run the query until the QuerySet is evaluated.
Topic guide Making queries
Some methods on managers and querysets - like get() and first() - force execution of the queryset and are blocking. Some, like filter() and exclude(), don’t force execution and so are safe to run from asynchronous code.
Reference Databases SQLite notes
SQLite does not support the SELECT ... FOR UPDATE syntax. Calling it will have no effect.
Reference
This document describes the details of the QuerySet API. It builds on the material presented in the model and database query guides, so you’ll probably want to read and understand those documents before reading this one.
Reference QuerySet API reference
Internally, a QuerySet can be constructed, filtered, sliced, and generally passed around without actually hitting the database. No database activity actually occurs until you do something to evaluate the queryset. You can evaluate a QuerySet in the following ways: Iteration.
Reference QuerySet API reference When QuerySets are evaluated
If you pickle a QuerySet, this will force all the results to be loaded into memory prior to pickling.
Reference QuerySet API reference
Here’s the formal declaration of a QuerySet: classQuerySet(model=None,query=None,using=None,hints=None)[source] : Usually when you’ll interact with a QuerySet you’ll use it by chaining filters. To make this work, most QuerySet methods return new querysets.
Reference QuerySet API reference QuerySet API
Django provides a range of QuerySet refinement methods that modify either the types of results returned by the QuerySet or the way its SQL query is executed.
Reference QuerySet API reference QuerySet API
Combined querysets must use the same model.
Reference QuerySet API reference QuerySet API
The following QuerySet methods evaluate the QuerySet and return something other than a QuerySet. These methods do not use a cache (see Caching and QuerySets). Rather, they query the database each time they’re called.