That's what I am looking for, since the ORM is able to
find all the children of a deleted object, I thought I might use
the same functionality to find all the children on the object
and delete them directly.


On Dec 6, 2:55 am, svilen <[EMAIL PROTECTED]> wrote:
> On Wednesday 05 December 2007 23:36:12 kris wrote:
>
>
>
> > with sqlalchemy 0.4.1,
>
> > Is there an idiom for delete the children of the object
> > without actually deleting the object itself?
>
> > I tried
> > session.delete (obj)
> > session.flush()
> > # add new children
> > session.save (obj)
> > session.flush()
>
> > But it gave me the error
> >    InvalidRequestError: Instance '[EMAIL PROTECTED]' is already
> > persistent
>
> > which does not appear correct either.
>
> u'll probably have to first detach the children from the
> parent.relation somehow?
--~--~---------~--~----~------------~-------~--~----~
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