django1/django/db
Anssi Kääriäinen 6b4834952d Fixed #16649 -- Refactored save_base logic
Model.save() will use UPDATE - if not updated - INSERT instead of
SELECT - if found UPDATE else INSERT. This should save a query when
updating, but will cost a little when inserting model with PK set.

Also fixed #17341 -- made sure .save() commits transactions only after
the whole model has been saved. This wasn't the case in model
inheritance situations.

The save_base implementation was refactored into multiple methods.
A typical chain for inherited save is:
save_base()
    _save_parents(self)
        for each parent:
            _save_parents(parent)
            _save_table(parent)
    _save_table(self)
2013-03-14 11:01:47 +02:00
..
backends Improved recovery when the connection is closed in an atomic block. 2013-03-13 15:17:40 +01:00
models Fixed #16649 -- Refactored save_base logic 2013-03-14 11:01:47 +02:00
__init__.py Added some assertions to enforce the atomicity of atomic. 2013-03-11 14:48:55 +01:00
transaction.py Made atomic usable when autocommit is off. 2013-03-13 15:17:40 +01:00
utils.py Deprecated TransactionMiddleware and TRANSACTIONS_MANAGED. 2013-03-11 15:04:05 +01:00