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