Re: [sqlalchemy] SQLAlchemy 1.1.4 - How do I get SQLAlchemy to raise an exception when appending a duplicate persistent object that is already mapped in a relationship?

2016-12-06 Thread mike bayer
this is a lot of code but generally to get the driver to raise an integrity error upon duplicate insert you need to use a unique constraint in your schema. I don't see the use of a UniqueConstraint here so you'd look to be adding that appropriately. It's the Postgresql database itself that d

[sqlalchemy] SQLAlchemy 1.1.4 - How do I get SQLAlchemy to raise an exception when appending a duplicate persistent object that is already mapped in a relationship?

2016-12-06 Thread 'dcs3spp' via sqlalchemy
Hi, I am running SQLAlchemy 1.1.4 connected to postgreSQL 9.6 on OSX Sierra 10.12.1. I am experiencing difficulty getting SQLAlchemy to raise an integrity error when a persistent object is appended to a relationship for which it is already associated with. Is the accepted method to manu