[sqlalchemy] Re: merge without merging related objects

2009-10-30 Thread Tvrtko
you want the cascade setting on history backref=backref(history, cascade='save-update') That did the trick! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: merge without merging related objects

2009-10-29 Thread Michael Bayer
Tvrtko wrote: Hi, is it possible to merge an object back to session, but without merging the entire tree of related objects. Just this one root object. the general way is to disable merge cascade on the relation(), using cascade='save-update' or cascade=None I created a new user instance

[sqlalchemy] Re: merge without merging related objects

2009-10-29 Thread Tvrtko
On Oct 29, 8:44 pm, Michael Bayer mike...@zzzcomputing.com wrote: Tvrtko wrote: Hi, is it possible to merge an object back to session, but without merging the entire tree of related objects. Just this one root object. the general way is to disable merge cascade on the relation(), using

[sqlalchemy] Re: merge without merging related objects

2009-10-29 Thread Michael Bayer
Tvrtko wrote: transient objects can be merged.  They get added to the session and enter the pending state. I get: InvalidRequestError: merge() with dont_load=True option does not support objects transient (i.e. unpersisted) objects. flush() all changes on mapped instances before

[sqlalchemy] Re: merge without merging related objects

2009-10-29 Thread Tvrtko
On Oct 29, 9:33 pm, Michael Bayer mike...@zzzcomputing.com wrote: Tvrtko wrote: transient objects can be merged.  They get added to the session and enter the pending state. I get: InvalidRequestError: merge() with dont_load=True option does not support objects transient (i.e.

[sqlalchemy] Re: merge without merging related objects

2009-10-29 Thread Tvrtko
Now on 0.4.8. And it is just not working. My copy method is flawed. Don't use it. The innards of sqlalchemy are just too complicated to mess around with. As for the cascade option. It also doesn't work. I have the following: mapper(History, history_table, properties = dict( user =

[sqlalchemy] Re: merge without merging related objects

2009-10-29 Thread Michael Bayer
On Oct 29, 2009, at 7:22 PM, Tvrtko wrote: Now on 0.4.8. And it is just not working. My copy method is flawed. Don't use it. The innards of sqlalchemy are just too complicated to mess around with. As for the cascade option. It also doesn't work. I have the following: mapper(History,