... validate_max parameter was added to BaseFormSet and formset_factory() , and ModelForm and inline versions of the same. The behavior of validation for formsets with max_num was clarified. The previously undocumented behavior that hardened formsets against ... _model argument, which when set to False allows the field to reference proxy models. The default is True to retain the old behavior. The LocaleMiddleware now stores the active language in session if it is not present there. This prevents loss of language ... ow preserves filters on the list view after creating, editing or deleting an object. It's possible to restore the previous behavior of clearing filters by setting the preserve_filters attribute to False . Added FormMixin.get_prefix (which returns FormMix ... ... validate_max parameter was added to BaseFormSet and formset_factory() , and ModelForm and inline versions of the same. The behavior of validation for formsets with max_num was clarified. The previously undocumented behavior that hardened formsets against ... _model argument, which when set to False allows the field to reference proxy models. The default is True to retain the old behavior. The LocaleMiddleware now stores the active language in session if it is not present there. This prevents loss of language ... ow preserves filters on the list view after creating, editing or deleting an object. It's possible to restore the previous behavior of clearing filters by setting the preserve_filters attribute to False . Added FormMixin.get_prefix (which returns FormMix ... ... e variable named myview ). Django 1.3 and above introduced the {% load url from future %} syntax to bring in the corrected behavior where myview was seen as a variable. The upshot of this is that if you are not using {% load url from future %} in your te ... ike for GET, and a request body for PUT requests like for POST. This encoding was arbitrary and inconsistent with Django's behavior when it receives the requests, so it was removed in Django 1.5. If you were using the data parameter in an OPTIONS or a DE ... isting page range. It does check it now and raises an InvalidPage exception when the number is either too low or too high. Behavior of autocommit database option on PostgreSQL changed ¶ PostgreSQL's autocommit option didn't work as advertised previously. ... ... e variable named myview ). Django 1.3 and above introduced the {% load url from future %} syntax to bring in the corrected behavior where myview was seen as a variable. The upshot of this is that if you are not using {% load url from future %} in your te ... ike for GET, and a request body for PUT requests like for POST. This encoding was arbitrary and inconsistent with Django's behavior when it receives the requests, so it was removed in Django 1.5. If you were using the data parameter in an OPTIONS or a DE ... isting page range. It does check it now and raises an InvalidPage exception when the number is either too low or too high. Behavior of autocommit database option on PostgreSQL changed ¶ PostgreSQL's autocommit option didn't work as advertised previously. ... ... for your application and define a RunPython or RunSQL operation in the operations section of the migration. Test rollback behavior is different for apps with migrations; in particular, Django will no longer emulate rollbacks on non-transactional databas ... gers ¶ Prior to Python 2.7, database cursors could be used as a context manager. The specific backend's cursor defined the behavior of the context manager. The behavior of magic method lookups was changed with Python 2.7 and cursors were no longer usable ... in_order_field value with a hyphen. The ModelAdmin.get_changeform_initial_data() method may be overridden to define custom behavior for setting initial change form data. django.contrib.auth ¶ Any **kwargs passed to email_user() are passed to the underlyi ... ... for your application and define a RunPython or RunSQL operation in the operations section of the migration. Test rollback behavior is different for apps with migrations; in particular, Django will no longer emulate rollbacks on non-transactional databas ... gers ¶ Prior to Python 2.7, database cursors could be used as a context manager. The specific backend's cursor defined the behavior of the context manager. The behavior of magic method lookups was changed with Python 2.7 and cursors were no longer usable ... in_order_field value with a hyphen. The ModelAdmin.get_changeform_initial_data() method may be overridden to define custom behavior for setting initial change form data. django.contrib.auth ¶ Any **kwargs passed to email_user() are passed to the underlyi ... ... utocommit (): ... Configurable delete-cascade ¶ ForeignKey and OneToOneField now accept an on_delete argument to customize behavior when the referenced object is deleted. Previously, deletes were always cascaded; available alternatives now include set nu ... nagement command that can be run manually or scheduled to run periodically via e.g. cron). PasswordInput default rendering behavior ¶ The PasswordInput form widget, intended for use with form fields which represent passwords, accepts a boolean keyword ar ... s now False , and developers who want the password value returned to the browser on a submission with errors (the previous behavior) must now explicitly indicate this. For example: class LoginForm ( forms . Form ): username = forms . CharField ( max_leng ... ... utocommit (): ... Configurable delete-cascade ¶ ForeignKey and OneToOneField now accept an on_delete argument to customize behavior when the referenced object is deleted. Previously, deletes were always cascaded; available alternatives now include set nu ... nagement command that can be run manually or scheduled to run periodically via e.g. cron). PasswordInput default rendering behavior ¶ The PasswordInput form widget, intended for use with form fields which represent passwords, accepts a boolean keyword ar ... s now False , and developers who want the password value returned to the browser on a submission with errors (the previous behavior) must now explicitly indicate this. For example: class LoginForm ( forms . Form ): username = forms . CharField ( max_leng ... ... ssential part of a solution, but it is not the only part. A good fix should also include a regression test to validate the behavior that has been fixed and to prevent the problem from arising again. If the code adds a new feature, or modifies the behavio ... Django might be deprecated: If a feature has been improved or modified in a backwards-incompatible way, the old feature or behavior will be deprecated. Sometimes Django will include a backport of a Python library that's not included in a version of Pytho ... eliminate or silence any warnings generated when running the tests. The first step is to remove any use of the deprecated behavior by Django itself. Next you can silence warnings in tests that actually test the deprecated behavior by using the ignore_wa ... ... ssential part of a solution, but it is not the only part. A good fix should also include a regression test to validate the behavior that has been fixed and to prevent the problem from arising again. If the code adds a new feature, or modifies the behavio ... Django might be deprecated: If a feature has been improved or modified in a backwards-incompatible way, the old feature or behavior will be deprecated. Sometimes Django will include a backport of a Python library that's not included in a version of Pytho ... eliminate or silence any warnings generated when running the tests. The first step is to remove any use of the deprecated behavior by Django itself. Next you can silence warnings in tests that actually test the deprecated behavior by using the ignore_wa ... 2026年10月08日