Thanks for the help with my query the other day - as ever response was swift
and bang on.

I'm now trying to set up another m:n relationship in ORM correctly.
Pseudocode:

parentA.children.append(child1)
parentA.children.append(child2)

parentB.children.append(child2)

session.delete(parentA)

At this stage, I would like child1 to be deleted and child2 to survive.

However, if I use (cascade = "all"), then both children will be deleted when
ParentA is. I hoped that delete-orphan would be applicable in this
situation, but that requires that single-parent be True, which I understand
it cannot for a true many-to-many.

So I guess what I am asking is - is it possible for child objects which have
still have remaining parents to survive, while deleting those with no
parents left?

Thanks,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to