Re: [sqlalchemy] duplicate an object

2015-03-11 Thread moonkid
On 2015-03-08 11:17 Michael Bayer wrote: > new_obj = MyClass() > for attr in mapper.attrs: > setattr(new_obj, attr.key, getattr(old_obj, attr.key)) This would copy everything including primary keys and unique members. I have hard problems with the SQLA-docu. I know that 'attr' is from type '

Re: [sqlalchemy] duplicate an object

2015-03-11 Thread moonkid
On 2015-03-08 11:17 Michael Bayer wrote: > there’s no particular “SQLAlchemy way” to do this, What is about make_transient() ? I don't understand this function 100%tly. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from

[sqlalchemy] Re: Having a proxy attribute along a relationship path

2015-03-11 Thread Florian Rüchel
You are correct. I wanted to see the query int produces to verify it works (in a small test case) and got an error that I did not make sense to me. I tried to used joinedload on the proxy, something that does not seem to work. But if I explicitly specify the chain as loading strategies, the cor