hollister wrote:
>
>
> # mappers
> mapper(Keyphrase, keyphrase_table)
> mapper(Action, action_table)
>
> mapper(KeyphraseAction, keyphrase_action_table, properties={
>         'keyphrase': relation(Keyphrase,
>             backref = 'keyphrase_action'),
>         'action': relation(Action),
>     })
>
> # test
> for i, action in enumerate(kp.actions):
>     print action.action_name
>     kp.actions.remove(action)   # this fails!
>
> s.commit()

you need to configure cascade so that SQLA knows to delete a
KeyphraseAction when it is deassociated from a Keyphrase.  See the mapping
docs for information on "delete" cascade.


--~--~---------~--~----~------------~-------~--~----~
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