... .db.transaction.savepoint() alias to django.db.transaction.savepoint_create() will be removed. Support for Model.from_db() methods that do not accept the fetch_mode keyword argument will be removed. 6.1 See the Django 5.2 release notes for more details ... Django 5.1 release notes for more details on these changes. The ModelAdmin.log_deletion() and LogEntryManager.log_action() methods will be removed. The undocumented django.utils.itercompat.is_iterable() function and the django.utils.itercompat module wi ... e flags in regular expression groups ( (?i) , (?L) , (?m) , (?s) , and (?u) ) will be removed. Support for Widget.render() methods without the renderer argument will be removed. 2.0 See the Django 1.9 release notes for more details on these changes. The ... ... b method on database routers is now called allow_migrate , but still performs the same function. Routers with allow_syncdb methods will still work, but that method name is deprecated and you should change it as soon as possible (nothing more than renami ... rite custom Field subclasses; if you do, you may need to reimplement the deconstruct() method if your subclass changes the method signature of __init__ in any way. If your field just inherits from a built-in Django field and doesn't override __init__ , ... nd out how to make your own classes serializable, read the migration serialization documentation . Calling custom QuerySet methods from the Manager Historically, the recommended way to make reusable model queries was to create methods on a custom Manage ... ... mpatible changes, detailed in CSRF Protection , below. Authors of custom Field subclasses should be aware that a number of methods have had a change in prototype, detailed under get_db_prep_*() methods on Field , below. The internals of template tags ha ... required() , and permission_required() , decorators from django.contrib.auth only apply to functions and no longer work on methods. There's a simple one-line fix detailed below . Again, these are just the big features that will affect the most users. Us ... non-SMTP technique for sending mail, you can now construct an email backend that will allow Django's standard mail sending methods to use those facilities. This also makes it easier to debug mail sending. Django ships with backend implementations that a ... ... ドが has_perm() および has_module_perms() で PermissionDenied を発生させられるようになりました。 PasswordResetForm now has a method send_mail() that can be overridden to customize the mail to be sent. The max_length of Permission.name has been increased f ... acters from the path portion of a Uniform Resource Identifier (URI) properly. HttpResponse now implements a few additional methods like getvalue() so that instances can be used as stream objects. The new HttpResponse.setdefault() method allows setting a ... ditional view processing now supports the If-unmodified-since header. テスト The RequestFactory.trace() and Client.trace() methods were implemented, allowing you to create TRACE requests in your tests. The count argument was added to assertTemplateUsed( ... ... ) , aggregate() , and extra() methods were subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the ** ... kwargs passed to these methods. CVE-2022-28347: Potential SQL injection via QuerySet.explain(**options) on PostgreSQL QuerySet.explain() method was subje ... ... and extra() QuerySet.annotate() , aggregate() , and extra() methods were subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the ** ... kwargs passed to these methods. CVE-2022-28347: Potential SQL injection via QuerySet.explain(**options) on PostgreSQL QuerySet.explain() method was subje ... ... relied on the internal _total_form_count or _initial_form_count attributes of BaseFormSet. Those attributes are now public methods. Fixed the join filter's escaping behavior The join filter no longer escapes the literal value that is passed in for the c ... objects in a QuerySet with the results of the aggregate query. This feature is available as new aggregate() and annotate() methods, and is covered in detail in the ORM aggregation documentation . Query expressions Queries can now refer to another field ... se particular fields, you can now tell Django not to retrieve them from the database. You'll do this with the new queryset methods defer() and only() . Testing improvements A few notable improvements have been made to the testing framework . Test perfor ... ... bility in truncatechars_html and truncatewords_html template filters If django.utils.text.Truncator 's chars() and words() methods were passed the html=True argument, they were extremely slow to evaluate certain inputs due to a catastrophic backtracking ... vulnerability in a regular expression. The chars() and words() methods are used to implement the truncatechars_html and truncatewords_html template filters, which were thus vulnerable. The back ... ... ained a --all option. django.forms.fields.Field.__init__ now calls super() , allowing field mixins to implement __init__() methods that will reliably be called. The validate_max parameter was added to BaseFormSet and formset_factory() , and ModelForm an ... ta --pks option specifies the primary keys of objects to dump. This option can only be used with one model. Added QuerySet methods first() and last() which are convenience methods returning the first or last object matching the filters. Returns None if ... elds added to a QuerySet by select_related() can be cleared using select_related(None) . The get_extra() and get_max_num() methods on InlineModelAdmin may be overridden to customize the extra and maximum number of inline forms. Formsets now have a total ... ... bility in truncatechars_html and truncatewords_html template filters If django.utils.text.Truncator 's chars() and words() methods were passed the html=True argument, they were extremely slow to evaluate certain inputs due to a catastrophic backtracking ... vulnerability in a regular expression. The chars() and words() methods are used to implement the truncatechars_html and truncatewords_html template filters, which were thus vulnerable. The back ... 2026年10月08日