no autoflush before table.delete()

Issue #2550 resolved
Jasper Spaans created an issue

See the attached script for a test case, output on my system (64 bit linux, custom built python 2.7.3, SA 0.7.8) is:

spaans@spaans64:~/projects/rgs/python$ LD_LIBRARY_PATH=/opt/python/lib bin/python test_sql.py Testing with SA '0.7.8' expect 0, got 1 expect 0, got 0 expect 1, got 1 expect 0, got 0

Comments (3)

  1. Mike Bayer repo owner

    Autoflush is not part of the contract of the execute() method, which instead represents the means of going "outside" of the usual ORM mechanics to do something with the database more directly. For a plain table delete within the scope of the ORM try using query(Test).delete() instead.

  2. Log in to comment