... EmptyResultSet ( #28378 ). Fixed a regression in pickling of LazyObject on Python 2 when the wrapped object doesn't have __reduce__() ( #28389 ). Fixed crash in runserver 's autoreload with Python 2 on Windows with non- str environment variables ( #281 ... ... すために一括(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 ( h ... it's appropriate for your use case. 一括で更新する When updating objects, where possible, use the bulk_update() method to reduce the number of SQL queries. Given a list or queryset of objects: entries = Entry . objects . bulk_create ( [ Entry ( headli ... g different pairs of objects into ManyToManyField or when the custom through table is defined, use bulk_create() method to reduce the number of SQL queries. For example: PizzaToppingRelationship = Pizza . toppings . through PizzaToppingRelationship . o ... ... upgrading multiple instances of the same project to Django 3.1 ( #31864 ). Adjusted admin's navigation sidebar template to reduce debug logging when rendering ( #31865 ). Fixed a data loss possibility in the select_for_update() . When using related fie ... ... E and is similar to an on-demand call to QuerySet.prefetch_related() or prefetch_related_objects() . Using FETCH_PEERS can reduce most cases of the "N+1 queries problem" to two queries without much effort. The "peer" instances are tracked in a list of ... ... of Python generators to efficiently handle the assembly and transmission of a large CSV file. Rows are batched together to reduce HTTP overhead and improve compression efficiency when used with GZipMiddleware : import csv from itertools import batched ... ... checking for these issues before code review it allows the reviewer to focus on the change itself, and it can also help to reduce the number of CI runs. To use the tool, first install pre-commit and then the git hooks: / $ python -m pip install pre ... ... d objects such as add() or direct assignment ran multiple data modifying queries without wrapping them in transactions. To reduce the risk of data corruption, all data modifying methods that affect multiple related objects (i.e. add() , remove() , clea ... jango would magically import myapp.views.myview internally and turn the string into a real function reference. In order to reduce repetition when referencing many views from the same module, the patterns() function takes a required initial prefix argum ... ... ar to the case for middleware , there is a small performance cost to adapting receivers in this way. Note that in order to reduce the number of sync/async calling-style switches within a send() or asend() call, the receivers are grouped by whether or n ... ... LOGIN_URL and LOGIN_REDIRECT_URL settings now also accept view function names and named URL patterns . This allows you to reduce configuration duplication. More information can be found in the login_required() documentation. Django now provides a mod_ ... ... ansforms. The new CONN_HEALTH_CHECKS setting allows enabling health checks for persistent database connections in order to reduce the number of failed requests, e.g. after database server restart. QuerySet.bulk_create() now supports updating fields whe ... 2026年10月08日