[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-17 Thread Michael Bayer
On May 17, 2007, at 4:16 AM, Andreas Jung wrote: > The FAQ does not explain the problem. Look at the real code: > > >def importImagesFromFilesystem(self, lidx, imgdir): >""" Import all images from a local filesystem into >the staging area of the Medium. >""" > >

[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-17 Thread Andreas Jung
--On 17. Mai 2007 02:17:22 -0700 Glauco <[EMAIL PROTECTED]> wrote: Try this: don't use files = [] files.append(vf) but use directly parent mapper: medium.versions[0].files.append( vf ) This won't solve my problem. I rewrote parts of the code in the following way: version =

[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-17 Thread Glauco
Try this: don't use files = [] files.append(vf) but use directly parent mapper: medium.versions[0].files.append( vf ) Glauco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this

[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-17 Thread Andreas Jung
--On 17. Mai 2007 10:16:17 +0200 Andreas Jung <[EMAIL PROTECTED]> wrote: --On 16. Mai 2007 13:45:21 -0400 Michael Bayer <[EMAIL PROTECTED]> wrote: This code causes the trouble. There is no save() operation involved - just a flush() operation driven by the Zope transaction integration of SA

[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-17 Thread Andreas Jung
--On 16. Mai 2007 13:45:21 -0400 Michael Bayer <[EMAIL PROTECTED]> wrote: new to the FAQ: http://www.sqlalchemy.org/trac/wiki/ FAQ#FlushError:instancesomeinstanceisanunsavedpendinginstanceandisanorph an The FAQ does not explain the problem. Look at the real code: def importImagesF

[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-17 Thread Glauco
> http://www.sqlalchemy.org/trac/wiki/ > FAQ#FlushError:instancesomeinstanceisanunsavedpendinginstanceandisanorph > an I think this is not Andreas an I too are searching to explain. The documentation is correct, and infact in tg-admin all go perfeclty.. but when the same example is gone from TG

[sqlalchemy] Re: cascade='all, delete-orphan' causing error about unsaved, pending instances

2007-05-16 Thread Michael Bayer
new to the FAQ: http://www.sqlalchemy.org/trac/wiki/ FAQ#FlushError:instancesomeinstanceisanunsavedpendinginstanceandisanorph an On May 16, 2007, at 11:16 AM, Andreas Jung wrote: > > > > I am building a media database using SA where the model basically maps > > Medium --1:N--> Versions --1:N