14 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Setting instrument l...
FromSent OnAttachments
Rick Morrison17 Jan 2008 15:40 
jason kirtland17 Jan 2008 15:59 
Rick Morrison17 Jan 2008 16:11 
jason kirtland17 Jan 2008 16:31 
Rick Morrison17 Jan 2008 16:35 
Michael Bayer17 Jan 2008 16:40 
Rick Morrison17 Jan 2008 16:51 
jason kirtland17 Jan 2008 16:54 
Michael Bayer17 Jan 2008 16:58 
Michael Bayer17 Jan 2008 17:03 
Michael Bayer17 Jan 2008 17:07 
Rick Morrison17 Jan 2008 17:17.r
Rick Morrison17 Jan 2008 17:43 
Rick Morrison17 Jan 2008 17:50 
Subject:[sqlalchemy] Re: Setting instrument list items
From:Rick Morrison (rick@gmail.com)
Date:01/17/2008 05:17:23 PM
List:com.googlegroups.sqlalchemy
Attachments:
r - 16k

do your setProp() operation, then do this:

(added, unchanged, deleted) = MyClass.props.get_history(myobject)

to see whats actually in there. it should just be a collection of "added" objects (and also, the correct objects).

Yep, so far so good. Two Prop items in 'added'

Then, use echo_uow=True on your session to see the flush plan. everything in the flush plan should also be in an "added" collection somewhere. also look inside of session.new, see if all the correct stuff is in there too.

session.new contents looks ok, with both Prop items and some other objects

The UOW is large and complex (attached, the "Prop" items are named "Invoiceattr"), but I do see the Prop items in there, two of them.

and......

same (database) error on flush

Objects which get removed from the collection due to your operation should be raising an "orphan" error right now, since theyre in the session but have no parent....seems like thats what your FK error is but its unusual that the orphan detection wouldn't be working.

OK, I get the basic idea; expunge isn't automatic. Let me rework the setProp to get things running again here, and then I'll pick up the discussion about that.