Re: [sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-09 Thread Alessandro Dentella
On Fri, Dec 04, 2009 at 02:52:37PM -0500, Michael Bayer wrote: On Dec 4, 2009, at 2:20 PM, Alessandro Dentella wrote: On Fri, Dec 04, 2009 at 01:27:46PM -0500, Michael Bayer wrote: On Dec 4, 2009, at 1:18 PM, Alessandro Dentella wrote: Is the only solution to attach an instance

Re: [sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-04 Thread Alessandro Dentella
Is the only solution to attach an instance (u.job = myjob) or is there another solution that doesn't require me to build the instance? if you want SQLA's delete-orphan capability, that's the only way. If you want to rely upon CASCADE rules in your DB to handle it instead, that's

Re: [sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-04 Thread Michael Bayer
On Dec 4, 2009, at 1:18 PM, Alessandro Dentella wrote: Is the only solution to attach an instance (u.job = myjob) or is there another solution that doesn't require me to build the instance? if you want SQLA's delete-orphan capability, that's the only way. If you want to rely upon CASCADE

Re: [sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-04 Thread Alessandro Dentella
On Fri, Dec 04, 2009 at 01:27:46PM -0500, Michael Bayer wrote: On Dec 4, 2009, at 1:18 PM, Alessandro Dentella wrote: Is the only solution to attach an instance (u.job = myjob) or is there another solution that doesn't require me to build the instance? if you want SQLA's

Re: [sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-04 Thread Michael Bayer
On Dec 4, 2009, at 2:20 PM, Alessandro Dentella wrote: On Fri, Dec 04, 2009 at 01:27:46PM -0500, Michael Bayer wrote: On Dec 4, 2009, at 1:18 PM, Alessandro Dentella wrote: Is the only solution to attach an instance (u.job = myjob) or is there another solution that doesn't require me to

[sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-03 Thread Alessandro Dentella
Hi, I'm stuck with the code below raise FlushError complaining: Traceback (most recent call last): File stdin, line 49, in module File /misc/src/sqlalchemy/sqlalchemy/lib/sqlalchemy/orm/session.py, line 673, in commit self.transaction.commit() File

Re: [sqlalchemy] FlushError: instance is in unsaved, pending instance...

2009-12-03 Thread Michael Bayer
On Dec 3, 2009, at 1:23 PM, Alessandro Dentella wrote: Hi, I'm stuck with the code below raise FlushError complaining: Traceback (most recent call last): File stdin, line 49, in module File /misc/src/sqlalchemy/sqlalchemy/lib/sqlalchemy/orm/session.py, line 673, in commit