On Jun 6, 11:32 pm, Michael Bayer <[email protected]> wrote:
>
> The table referenced by "secondary=" in a relationship() is managed entirely, 
> regardless of cascade setting, but
> only from the perspective of the parent.  Meaning if A references a 
> collection of B, the row in a_to_b will be
> deleted if you 1. delete A, or 2. remove a B from A's collection.   Deleting 
> a B by itself as in session.delete(B)
> won't have an effect unless you apply a backref to the relationship so that 
> each B also knows about its collection
> of  A.

I am indeed deleting B but in this case I do have the backref
specified in the parent table A e.g.

Class A(Base):
  toB = relationship('B', secondary=a_b, backref='toA')

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

Reply via email to