Ok, the title doesn't say much, so I'll try to explain my problem with
an example:

I have two classes:

class A(object) :
    pass

class B(object) :
    pass

which are bounded by a relation:

a_tab = Table(...)
b_tab = Table(...)
b_tab.append_constraint(ForeignKeyConstraint([a_tab.c.id],
[b_tab.c.a_id]))
mapper(A, a_tab, properties={"rel": relationship(B)})
mapper(B, b_tab)

a_tab is already populated and has a lot of records (say 200 000),
while b_tab is empty.
So I load data from a_tab and populate b_tab this way:

a_data = self.session.query(A).all()
engine.execute(b_tab.insert(), [{"a_id":x.id} for x in a_data])

now, of course, a_data[0].rel is []

Is there a way (possibly a fast way) to update the data of the
relation 'rel' in the records of a_data?

Thanks in advance for your help!

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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