On Tuesday, April 7, 2015 at 4:00:28 PM UTC-7, Michael Bayer wrote:
>
> One event approach would be the before_flush() event, you search through
> session.deleted for all Container objects; within Container, locate all Tag
> entries with that Container as the ultimate parent and mark them all as
How can I cascade delete from a many to one only when deleting the many
means this one has no other children?
Imagine the following mapping:
class Container(Base):
__tablename__ = 'container'
pk = sa.Column(sa.Integer, primary_key=True)
entries = relationship('Entry', backref='c