... nyField ( Topping ) この例では、以下のメソッドは topping.pizza_set と pizza.toppings の両方で利用できます。 add ( * objs , bulk = True , through_defaults = None ) aadd ( * objs , bulk = True , through_defaults = None ) 非同期バージョン : aadd() リレー ... リレーションの場合、 QuerySet.update() を使って更新を行います。これにはオブジェクトが既に保存されている必要があります。 引数 bulk=False を使用することで、関係マネージャが e.save() を呼び出して更新を行うことができます。 しかし、多対多のリレーションシップ ... で add() を使用すると、 save() メソッドは呼び出しません ( bulk 引数は存在しません)。 QuerySet.bulk_create() を使用してリレーションシップを作成します。リレーションシップの作成時にカスタム ... ... ficiency. Use the FETCH_PEERS fetch mode Use the FETCH_PEERS fetch mode to make on-demand field access more efficient with bulk-fetching. Enable it for all usage of your models with a custom manager . Using this fetch mode is easier than declaring fi ... ックスを追加すると、並べ替えのパフォーマンスが向上する可能性があります。 一括メソッドを使用する SQL文の数を減らすために一括(bulk)メソッドを使用する 一括で作成する When creating objects, where possible, use the bulk_create() method to reduce the number ... of SQL queries. For example: Entry . objects . bulk_create ( [ Entry ( headline = "This is a test" ), Entry ( headline = "This is only a test" ), ] ) ...これは下記よりも適切で ... ... を使用していて、オブジェクトを作成する必要があるが、そのキーが既にデータベースに存在する場合、 IntegrityError が発生します。 bulk_create() bulk_create ( objs , batch_size = None , ignore_conflicts = False , update_conflicts = False , update_fields = No ... ne , unique_fields = None ) abulk_create ( objs , batch_size = None , ignore_conflicts = False , update_conflicts = False , update_fields = None , unique_fi ... elds = None ) 非同期バージョン : abulk_create() このメソッドは、指定されたオブジェクトのリストを効率的な方法でデータベースに挿入し (通常、オブジェクトの数にかかわ ... ... した際にクラッシュするバグが修正されました ( #34139 )。 Django 4.1 で、 unique_fields に "pk" が含まれている場合に QuerySet.bulk_create() がクラッシュするバグが修正されました ( #34177 )。 Django 4.1 で、 db_column が設定されたフィールドに対して QueryS ... et.bulk_create() を使用するとクラッシュするバグが修正されました ( #34171 )。 ... ... by QuerySet.bulk_create() on PostgreSQL ( #33647 ). Fixed a regression in Django 6.0 where querystring mishandled multi-value QueryDict key ... 3.14) ignored the --no-color option and the DJANGO_COLORS setting ( #36376 ). Fixed a regression in Django 6.0 that caused bulk_create() to crash when introspecting the connection on SQLite ( #36818 ). Fixed a visual regression in Django 6.0 for admi ... ... ue has severity "moderate" according to the Django security policy . バグ修正 Fixed a regression in Django 6.0 that caused bulk_create() to crash on databases that support returning rows from bulk inserts when a related object providing the primary k ... ... ted by QuerySet.bulk_create() on PostgreSQL ( #33647 ). Fixed a bug where management command colorized help (introduced in Python 3.14) ignored ... ... ew list_editable admin option. These fields will show up as form widgets on the list pages, and can be edited and saved in bulk. Admin "actions" You can now define admin actions that can perform some action to a group of models in bulk. Users will be ... able to select objects on the change list page and then apply these bulk actions to all selected objects. Django ships with one pre-defined admin action to delete a group of objects in one fell s ... ... )。 Django 5.2 において、JSONField に対して None を SQL の NULL ではなく JSON の null に誤って変換してしまっていた QuerySet.bulk_update() のリグレッションを修正しました( #36419 )。 Django 5.2.2 において、内部の django.http.MediaType.params プロパティ ... ... hmigrations command now supports specifying the starting migration from which migrations will be squashed. モデル QuerySet.bulk_create() now works on proxy models. Database configuration gained a TIME_ZONE option for interacting with databases that s ... gers created by ForeignKey , GenericForeignKey , and ManyToManyField . The add() method on a reverse foreign key now has a bulk parameter to allow executing one query regardless of the number of objects being added rather than one query per object. A ... ed parameters on SQLite. Query expressions can now be used when creating new model instances using save() , create() , and bulk_create() . Request と Response Unless HttpResponse.reason_phrase is explicitly set, it now is determined by the current va ... 2026年10月08日