On 2015-03-08 11:17 Michael Bayer <[email protected]> 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 'class ColumnProperty'. But I am not able to found out the members
of it. I can not see a 'primary_key' or a 'unique' member inside of it.

How can I "ask" if it is a primary key or unique?

And much better for the future: How do I have to use the SQLA-docu to
solve such problems myself? What do I understand wrong in that docu?

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to