Hi Rick,
Thanks for your continuing interest in my silly problem
Rick Morrison wrote:
> How are you deleting the rows? Is this via Session.flush(), or an SQL
> expression statement?
>
Via a session commit/flush
> Please post some code as to how you're trying this...
The code goes something like this (not actual code!)
for x in listofproducts:
contlist=sess.query(Container).filter_by(Content=x).all()
for y in contlist:
quantity[x]-=y.Take(quantity[x])
if y.quantity==0:
sess.delete(y)
if quantity[x]==0:
break
sess.begin()
try:
sess.commit()
print "OK"
except:
sess.rollback()
print "Ooops!"
If only one container needs to be deleted, it works. More than one and
it fails. It all
works when using MySQL.
Cheers,
François
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---