[Patch] Marking instances as db-stored via is_stored
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||yes|
This patch adds a flag to instance called 'is_stored'. By default it is set to None. When a DB instance is available in the database it is True, and when its removed it is False.
This corrects the need for Django guessing based on the PK value if it needs to try to do an update or insert, and should throw exceptions if you try to do an insert (.create) when a matching pk exists.
Change History (16)
comment:2 Changed 10 years ago by
|Patch needs improvement:||set|