new_a=A() session.begin() session.add(new_a) session.flush() new_b=B() new_b.a_id=new_a.id session.add(new_b)
try: session.commit() except: session.rollback() raise this code is right? when error all be rollback? -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
