Opened 15 years ago
Last modified 9 years ago
#12685 closed
Serialized objects' save function does not respect force_insert — at Initial Version
Reported by: | dcotruta | Owned by: | nobody |
---|---|---|---|
Component: | Core (Serialization) | Version: | 1.1 |
Severity: | Normal | Keywords: | save, force_insert, force_update |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Given a serialized trivial object, of the type models.Model, which does not override any functions, a deserialized object does not accept the force_insert keyword argument for its save function.
class XYZ(models.Model):
xyz_creation_date = models.DateTimeField(verbose_name=_("Date Opened"),
blank=False,
auto_now_add=True,
editable=False
)
xyz_is_open = models.BooleanField(default=True)
xyz_last_updated = models.DateTimeField(verbose_name=_("Last Report"),
blank=False,
auto_now=True
)
xyz_synced = models.BooleanField(default=False)
If this model exists on two separate servers, and instances of this object are serialized, passed over the wire, and then deserialized, the save function on the receiving server cannot pass force_insert=True - doing so yields "save() got an unexpected keyword argument 'force_insert'".
Any ideas?