diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2012-11-29 12:10:31 +0200 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2013-03-14 11:01:47 +0200 |
| commit | 6b4834952dcce0db5cbc1534635c00ff8573a6d8 (patch) | |
| tree | fdf79be9ab8152086cf7401b949720ca1597c35e /tests/admin_scripts | |
| parent | 8a2f5300b21c3c20a9fc6829d9fcadb023cba4a8 (diff) | |
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)
Diffstat (limited to 'tests/admin_scripts')
0 files changed, 0 insertions, 0 deletions
