Explorar o código

Correct scoping of savepoint example

David Cramer %!s(int64=10) %!d(string=hai) anos
pai
achega
27f68f8659
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      docs/topics/db/transactions.txt

+ 1 - 1
docs/topics/db/transactions.txt

@@ -492,8 +492,8 @@ you can roll back the single offending operation, rather than the entire
 transaction. For example::
 
     a.save() # Succeeds, and never undone by savepoint rollback
+    sid = transaction.savepoint()
     try:
-        sid = transaction.savepoint()
         b.save() # Could throw exception
         transaction.savepoint_commit(sid)
     except IntegrityError: