Hi, I have a similar prolem as described in https://groups.google.com/forum/#!topic/sqlalchemy/OLeCERDZxyk
I am using the secondary attribute to define the many-to-many relationship between User and Groups. Now i want prevent to delete a group if a user is still in the group. Setting the Foreign-Key to "nullable=False" as advised in the post above does not work for me on SQLAlchemy level. It does work when trying to delete the Group directly in Postgres (Error ist raised). I am using no cascading deletes in the relation definition. I assume this has somethong to do with the default behaviour of deleting rows in many-to-many relationsships when using the secondary attribtute as described here: http://docs.sqlalchemy.org/en/rel_0_9/orm/basic_relationships.html#deleting-rows-from-the-many-to-many-table So I am wondering if there is a easy way to change this behavior. Or will i need to use an association table? Torsten -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.