Commit 5d22dc3e authored by Tim Peters's avatar Tim Peters

Purge Five of get_transaction() calls.

parent f54a143b
......@@ -58,7 +58,8 @@ The Zope Object Database, ZODB, version 3.0
Don't forget to::
get_transaction().commit()
import transaction
transaction.commit()
If you want any changes to made to be saved.
......
......@@ -19,6 +19,9 @@ $Id: browser.py 9730 2005-03-10 22:50:43Z jw $
import sys
from datetime import datetime
# ZODB
import transaction
# Zope 2
import Acquisition
from Acquisition import aq_inner, aq_parent, aq_base
......@@ -212,7 +215,7 @@ class EditView(BrowserView):
except WidgetsError, errors:
self.errors = errors
status = "An error occured."
get_transaction().abort()
transaction.abort()
else:
setUpEditWidgets(self, self.schema, source=self.adapted,
ignoreStickyValues=True,
......
......@@ -17,6 +17,8 @@ import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
import transaction
from Products.Five.tests.fivetest import *
from Products.Five.tests.products.FiveTest.subscriber import clear
......@@ -60,7 +62,7 @@ class EventTest(FiveTestCase):
manage_addSimpleContent(self.folder, 'foo', 'Foo')
# somehow we need to at least commit a subtransaction to make
# renaming succeed
get_transaction().commit(1)
transaction.commit(1)
self.folder.manage_renameObject('foo', 'bar')
bar = self.folder.bar
events = objectEventCatcher.getEvents()
......@@ -94,7 +96,7 @@ class EventTest(FiveTestCase):
manage_addSimpleContent(folder1, 'foo', 'Foo')
foo = folder1.foo
# need to trigger subtransaction before copy/paste can work
get_transaction().commit(1)
transaction.commit(1)
cb = folder1.manage_cutObjects(['foo'])
folder2.manage_pasteObjects(cb)
newfoo = folder2.foo
......@@ -124,7 +126,7 @@ class EventTest(FiveTestCase):
manage_addNoVerifyPasteFolder(self.folder, 'folder1')
folder1 = self.folder.folder1
# need to trigger subtransaction before copy/paste can work
get_transaction().commit(1)
transaction.commit(1)
cb = self.folder.manage_copyObjects(['foo'])
folder1.manage_pasteObjects(cb)
foo_copy = folder1.foo
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment