Closed Jaymon closed 1 year ago
It's become a common workflow for me to set the primary key, and so I've had to change multiple orm's to do something like this:
from prom.exception import UniqueError def save(self): try: super(Foo, self).save() except UniqueError: self.update()
I think .save() should probably just automatically do this, and for the times I want specific error handling I can call .insert() or .update() manually.
.save()
.insert()
.update()
https://github.com/Jaymon/prom/issues/119
I think this is handled by Orm.upsert
Orm.upsert
It's become a common workflow for me to set the primary key, and so I've had to change multiple orm's to do something like this:
I think
.save()
should probably just automatically do this, and for the times I want specific error handling I can call.insert()
or.update()
manually.