If A has a sqlalchemy relationship to B you can merely:

a = A()

# one-to-one
a.b = B()

# one-to-many
a.b.append(B())

flush() is fine for getting the database-generated primary keys
without having to commit(), but with relationship() it is rarely
necessary.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to