Hi Mike,

thanks for the reply.

On Thursday, August 25, 2016 at 3:57:30 PM UTC+2, Mike Bayer wrote:
>
>
>
> well dependencyprocessor is about doing the objects in the right order, 
>

clear.
 

> and about invoking a command to "sync" important attributes from one 
> side to the other, which means copying the PK of one object to the FK of 
> another.  I guess in this case we'd be "copying" the PK of related 
> objects into the local object's comma-separated list of keys.   From 
>

exactly. The problem here is that these objects are not yet in the database 
so I can't copy the primary key because I don't know about it.
 

> that perspective this is not much of a "DependencyProcessor" problem 
> because you have this local attribute that just contains a view 
> (comma-separated-list of keys) of a collection attribute on the same 
> object.   That is, I don't see much of a "topological" problem here if 
>

How is this different from updating a column that contains the foreign key 
referring to another object (which is taken care of by a 
DependencyProcessor afaict)?
 

> I'm understanding correctly.   Copy-on-write is done by an attribute 
> event, object is written therefore we set a flag, in before_flush() we 
> copy all the objects that need to be copied-on-write, then I think you 
> have the after_flush there to update the parent object.    you can set 
> up Bundle.members there also. 
>

Actually the objects (which are mapped) are already copied beforehand so 
when flush is called I have a bunch of new objects which don't have any 
primary key yet.


Anyway, I seem unable to express myself so please do not spend more time on 
this. The current solution is working fine albeit slightly inefficient.

Thanks and Greetings, Torsten

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to