... es fetched by a QuerySet : from django.db import models books = Book . objects . fetch_mode ( models . FETCH_PEERS ) Fetch modes apply to: ForeignKey fields OneToOneField fields and their reverse accessors Fields deferred with QuerySet.defer() or Quer ... s, not just the top-level model in the initial QuerySet . This copying is also done in related managers, even though fetch modes don't affect such managers' queries. Available modes Referencing fetch modes Fetch modes are defined in django.db.models.f ... etch_modes , but for convenience they're imported into django.db.models . The standard convention is to use from django.db import mod ... ... hly recommend , and only officially support, the latest release of each series. What's new in Django 6.1 Model field fetch modes The on-demand fetching behavior of model fields is now configurable with fetch modes . These modes allow you to control ho ... w Django fetches data from the database when an unfetched field is accessed. Django provides three fetch modes: FETCH_ONE , the default, fetches the missing field for the current instance only. This mode represents Django's existing ... EERS fetch mode will make the above example perform only two queries: Fetch all books. Fetch associated authors. See fetch modes for more details. Database-level delete options for ForeignKey.on_delete ForeignKey.on_delete now supports database-level ... ... ... ort for Django models django.db.migrations.operations django.db.models django.db.models.constraints django.db.models.fetch_modes django.db.models.fields Built-in field types. django.db.models.fields.json django.db.models.fields.related Related field t ... ... ータベース モデル クエリを作成する Fetch modes アグリゲーション (集計) 検索 マネージャ 素の SQL 文の実行 データベースのトランザクション 複数のデータベース テーブル空間( ... ... sgi のインストール データベースを動かす Django コードをインストールする モデルとデータベース モデル クエリを作成する Fetch modes アグリゲーション (集計) 検索 マネージャ 素の SQL 文の実行 データベースのトランザクション 複数のデータベース テーブル空間( ... ... ncy() (django.db.migrations モジュール) django.db.models module django.db.models.constraints module django.db.models.fetch_modes module django.db.models.fields module django.db.models.fields.json module django.db.models.fields.related module django.db ... django.db.migrations django.db.migrations.operations django.db.models django.db.models.constraints django.db.models.fetch_modes django.db.models.fields django.db.models.fields.json django.db.models.fields.related django.db.models.functions django.db. ... ... って)ロックされた行を参照するだけの行を作成できる、より弱いロックを取得できます。PostgreSQLのドキュメントに row-level lock modes についての詳細があります。 null 可能なリレーションでは select_for_update() は使用できません: >>> Person . objects . select ... 2026年10月08日