You could use sqlacodegen (https://pypi.python.org/pypi/sqlacodegen) to
generate your model:
• generate both models
• generate one model, then regex the other
if you make a lookup table/function to map one column name to another, you
could also loop over the columns. something sort of like this:
for source_row in query(SourceObject).all()
kwargs = {}
for col in sqlalchemy_orm.class_mapper(source_row
.__class__).mapped_table.c:
destination_col = lookup_destination_column[col.name]
kwargs[destination_col] = getattr(source_row, col.name)
dbsession.add(DestinationObject(**kwargs))
--
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.