[sqlalchemy] Question on the precedence of insert and delete in session flush

2011-07-27 Thread ammar azif
Hi, I am using SQLAlchemy 0.6.4 with postgres db. I have two tables - users and addresses tables with addresses table having a foreign key constraint referencing the users table. Each address record is identified by a unique constraint key 'email_address'. In my test case, each user instance have

[sqlalchemy] Question about sqlalchemy inserts and deletes order in a transaction

2011-07-19 Thread ammar azif
Hi, The code that I am working on deletes rows from table A that are based on a certain query and then recreates these rows based on entries supplied by a csv file. Table A is referenced by table B. My question is, how does sql alchemy manage inserts and deletes in a transaction and it what order

[sqlalchemy] Question about how session works in SQLAlchemy

2010-12-28 Thread ammar azif
Hi, Attached is a simple script that inserts a record using Table.insert().execute() method and session.execute(Table.insert()). When I tried running session.execute(Table.select()), both records inserted by Table.insert().execute() and session.execute(Table.insert()) are retrieved, but when I