this clone stuff comes over and over and over...
i have similar .copy() in dbcook unfinished..

1) see prop.direction as one of (ONETOMANY, MANYTOONE, MANYTOMANY) to 
figure  the "direction" of the relation. why does it matter which 
side you're on? as long as u copy one side only..

as of 2) .. do u have backref=... declared on the relation()? 

ciao
svil

unfinished:
http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/usage/copydeep.py?view=markup
another thing works but may or may not help:
http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/aboutrel.py?view=markup

On Thursday 19 March 2009 15:44:50 Martin wrote:
> I've written my own deep_clone for SA Object Trees, which is
> exploiting quite some lowlevel calls inside SA
>
> This has brought me to reimplement the cloning for every major
> version change, I started in 0.3, updated to 0.4 with some major
> rework, but I simply cant get it to work with 0.5.2, and I wonder
> how or why?!?!?!
>
> there is 2 major reasons I could identify
>
> 1) is_backref allowed to judge which side of a backref I was on,
> now no similar property exists, which also means I run into
> circular CLONEs, which to prevent, there only seems to be
> (v.property.backref and v.property.backref.kwargs == {}) to judge
> what side I'm on
>
> 2) when I have a InstrumentedList property, i.e. I would getattr
> (newobj, 'property').append(elem), this would automatically set
> elem.`backref ` to the correct value, whereas now this is not
> updated until flushed, which causes me tremendous consternation
>
> for (2) I have no solution, this means I cant clone anymore without
> major rework? am I stupid?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to