[Zope-Checkins] SVN: Zope/branches/tim-merge-zodb34/ Purge Five of
get_transaction() calls.
Tim Peters
tim.one at comcast.net
Thu Mar 31 11:27:57 EST 2005
Log message for revision 29754:
Purge Five of get_transaction() calls.
Changed:
U Zope/branches/tim-merge-zodb34/doc/ZODB.txt
U Zope/branches/tim-merge-zodb34/lib/python/Products/Five/browser.py
U Zope/branches/tim-merge-zodb34/lib/python/Products/Five/tests/test_event.py
-=-
Modified: Zope/branches/tim-merge-zodb34/doc/ZODB.txt
===================================================================
--- Zope/branches/tim-merge-zodb34/doc/ZODB.txt 2005-03-31 16:11:16 UTC (rev 29753)
+++ Zope/branches/tim-merge-zodb34/doc/ZODB.txt 2005-03-31 16:27:57 UTC (rev 29754)
@@ -58,7 +58,8 @@
Don't forget to::
- get_transaction().commit()
+ import transaction
+ transaction.commit()
If you want any changes to made to be saved.
Modified: Zope/branches/tim-merge-zodb34/lib/python/Products/Five/browser.py
===================================================================
--- Zope/branches/tim-merge-zodb34/lib/python/Products/Five/browser.py 2005-03-31 16:11:16 UTC (rev 29753)
+++ Zope/branches/tim-merge-zodb34/lib/python/Products/Five/browser.py 2005-03-31 16:27:57 UTC (rev 29754)
@@ -19,6 +19,9 @@
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 @@
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,
Modified: Zope/branches/tim-merge-zodb34/lib/python/Products/Five/tests/test_event.py
===================================================================
--- Zope/branches/tim-merge-zodb34/lib/python/Products/Five/tests/test_event.py 2005-03-31 16:11:16 UTC (rev 29753)
+++ Zope/branches/tim-merge-zodb34/lib/python/Products/Five/tests/test_event.py 2005-03-31 16:27:57 UTC (rev 29754)
@@ -17,6 +17,8 @@
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 @@
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 @@
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 @@
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
More information about the Zope-Checkins
mailing list