backport TM.sortKey/setSortKey from Products.ZSQLMethod (previously on Zope 2.12)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37151 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 02293294
......@@ -29,3 +29,21 @@ def TM__register(self):
#except: pass
TM._register = TM__register
if getattr(TM, 'setSortKey', None) is None:
# BACK: We're not yet on Zope 2.12, patch in the sort_key setting method
# remove this part when we drop support for earlier versions.
def setSortKey(self, sort_key):
self._sort_key = sort_key
def sortKey(self, *ignored):
""" The sortKey method is used by the transaction subsystem to have a
known commit order for lock acquisition.
"""
return self._sort_key
TM._sort_key = 1
TM.setSortKey = setSortKey
TM.sortKey = sortKey
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