... also delete the file from the backend storage. This opened the door to several data-loss scenarios, including rolled-back transactions and fields on different models referencing the same file. In Django 1.3, when a model is deleted the FileField 's delete() ... as discovered that this feature has never completely worked as advertised. When using database backends that don't support transactions, or when using a TransactionTestCase, data that has been inserted using custom SQL will not be visible during the testing ... s and remain in the same situation considering the deprecation of such location. Transaction management When using managed transactions -- that is, anything but the default autocommit mode -- it is important when a transaction is marked as "dirty". Dirty tra ... ... e from the backend storage. This opened the door to several potentially serious data-loss scenarios, including rolled-back transactions and fields on different models referencing the same file. In Django 1.2.5, FileField will never delete files from the back ... as discovered that this feature has never completely worked as advertised. When using database backends that don't support transactions, or when using a TransactionTestCase, data that has been inserted using custom SQL will not be visible during the testing ... ... e loader to crash when using lazy template names ( #26603 ). Fixed on_commit callbacks execution order when callbacks make transactions ( #26627 ). Fixed HStoreField to raise a ValidationError instead of crashing on non-dictionary JSON input ( #26672 ). Fixe ... ... select_for_update() could be executed in autocommit mode, outside of a transaction. Before Django 1.6, Django's automatic transactions mode allowed this to be used to lock records until the next write operation. Django 1.6 introduced database-level autocomm ... r and raises an exception. This change was made because such errors can be caused by including an app which expects global transactions (e.g. ATOMIC_REQUESTS set to True ), or Django's old autocommit behavior, in a project which runs without them; and furthe ... ... , and Substr . TestCase data setup TestCase has been refactored to allow for data initialization at the class level using transactions and savepoints. Database backends which do not support transactions, like MySQL with the MyISAM storage engine, will still ... ine for a given feature, its removal may appear as a backwards incompatible change. Related object operations are run in a transaction Some operations on related 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() , remo ... ... by specifying further test labels after the first one: / $ ./runtests.py --pair basic.tests.ModelTest.test_eq queries transactions ...\> runtests.py --pair basic.tests.ModelTest.test_eq queries transactions You can also try running any set of tests in a ... ... use these applications, you no longer have to install their database tables. Django now has support for managing database transactions. たとえば LDAP などの他のシステムに対して認証中のユーザー向けに、カスタムの認証および認可バックエンドを作成する機能を追加し ... ... select_for_update() could be executed in autocommit mode, outside of a transaction. Before Django 1.6, Django's automatic transactions mode allowed this to be used to lock records until the next write operation. Django 1.6 introduced database-level autocomm ... r and raises an exception. This change was made because such errors can be caused by including an app which expects global transactions (e.g. ATOMIC_REQUESTS set to True ), or Django's old autocommit behavior, in a project which runs without them; and furthe ... ... は実行 されません が、MyISAMテーブルを持つMySQLでは実行されます)。 class MyTests ( TestCase ): @skipIfDBFeature ( "supports_transactions" ) def test_transaction_behavior ( self ): # ... conditional test code pass skipUnlessDBFeature ( * feature_name_strings ) ... 行されますが、MyISAMテーブルを持つMySQLでは実行 されません )。 class MyTests ( TestCase ): @skipUnlessDBFeature ( "supports_transactions" ) def test_transaction_behavior ( self ): # ... conditional test code pass ... ... ransaction , the functions commit_unless_managed and rollback_unless_managed , also defined in django.db.transaction , the TRANSACTIONS_MANAGED setting. The cycle and firstof template tags will auto-escape their arguments. In 1.6 and 1.7, this behavior is pr ... 2026年10月08日