Using"users =
relation('User', secondary=user_group_table, backref='groups',
cascade="all, delete, delete-orphan")
is not working. When an user is deleted, no entry from
user_group_table is deleted.
Regards
On 20 oct, 18:43, Alessandro Molina <[email protected]>
wrote:
> Adding cascade="all, delete, delete-orphan" to the relationship should do it.
>
> http://www.sqlalchemy.org/docs/orm/session.html#deleting-from-collect...
>
> 2011/10/20 Juan Antonio Ibáñez <[email protected]>:
>
>
>
>
>
>
>
> > Hello!
>
> > What is the best way to delete user-group relation when an user is
> > deleted? It seems that ondelete cascade definition is not working.
>
> > Regards
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "TurboGears" 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
> > athttp://groups.google.com/group/turbogears?hl=en.
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.