Commit Graph

7 Commits

Author SHA1 Message Date
f1c0ee336b Fix wrongly excluding relations if they were not in proper order and one of them were excluded. Fix for #779 (#890) 2022-10-21 14:38:16 +02:00
4fa0205598 Allow upserting rows with existing_pk even if they do not exist. (#889)
* Allow for __force_save__ in Model.upsert() method to save the models despite they already have a pk set. On integrity Error proceed to update the model, so in worst case two db calls will be made.

* Fix coverage

* Change implementation to checking if the row exists as postgres leaves hanging invalid transaction on integrity error. On force_save always check if row exists and then save/update (so always two queries).
2022-10-21 13:32:36 +02:00
a720ab9510 Fix populate_default_values 2021-11-16 10:12:24 +03:00
854b27947a modify save_related to be able to save whole tree from dict - including reverse fk and m2m relations - with correct order of saving 2021-04-12 17:39:42 +02:00
f615b7d55e add _columns to Model.update() 2021-04-06 11:00:11 +02:00
64d3d1b693 add exclude to save_related method, switch to same relation_map from iter 2021-03-30 16:26:10 +02:00
da05e5ba1d split tests into packages 2021-03-30 12:48:39 +02:00