Fundamentally the cascade applies to doing something to the 'many' side
when something happens on the 'one' side.
A many-to-many association can't do this sort of things, and in fact,
you can't just 'create' a many-to-many relationship in a relational
database. To implement a many-to-many relationship, you need an
intermediary table that is many-to-one with each of the two sides to
build that many-to-many relationship.
You could use a cascade to update this interconnection table, to delete
the cross connection terms when you delete one side of a relationship
(and if you don't you can't delete the items without first removing all
the relationships). By itself, this doesn't help you, but you could
create a trigger on deleting this crossing element, and have it check if
after it is gone if the secret it was connected to is now no longer
referenced, and if so delete the secret.
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
>
http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See
http://stackoverflow.com/help/mcve for a full
> description.
> ---
> 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+...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sqlalchemy/b5e4faee-5cd6-4b9b-936b-0d80458f55e4n%40googlegroups.com
> <
https://groups.google.com/d/msgid/sqlalchemy/b5e4faee-5cd6-4b9b-936b-0d80458f55e4n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Richard Damon