当前位置: 首页>>代码示例>>Python>>正文


Python Transaction.note方法代码示例

本文整理汇总了Python中transaction.Transaction.note方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.note方法的具体用法?Python Transaction.note怎么用?Python Transaction.note使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在transaction.Transaction的用法示例。


在下文中一共展示了Transaction.note方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: checkUndoInvalidation

# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import note [as 别名]
    def checkUndoInvalidation(self):
        oid = self._storage.new_oid()
        revid = self._dostore(oid, data=MinPO(23))
        revid = self._dostore(oid, revid=revid, data=MinPO(24))
        revid = self._dostore(oid, revid=revid, data=MinPO(25))

        info = self._storage.undoInfo()
        if not info:
            # Preserved this comment, but don't understand it:
            # "Perhaps we have an old storage implementation that
            #  does do the negative nonsense."
            info = self._storage.undoInfo(0, 20)
        tid = info[0]['id']

        # Now start an undo transaction
        t = Transaction()
        t.note('undo1')
        oids = self._begin_undos_vote(t, tid)

        # Make sure this doesn't load invalid data into the cache
        self._storage.load(oid, '')

        self._storage.tpc_finish(t)

        assert len(oids) == 1
        assert oids[0] == oid
        data, revid = self._storage.load(oid, '')
        obj = zodb_unpickle(data)
        assert obj == MinPO(24)
开发者ID:1-Hash,项目名称:ZEO,代码行数:31,代码来源:Cache.py

示例2: undo

# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import note [as 别名]
 def undo(self, tid, note=None):
     t = Transaction()
     if note is not None:
         t.note(note)
     oids = self._begin_undos_vote(t, tid)
     self._storage.tpc_finish(t)
     return oids
开发者ID:NextThought,项目名称:ZODB,代码行数:9,代码来源:TransactionalUndoStorage.py

示例3: undo

# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import note [as 别名]
 def undo(self, tid, note):
     t = Transaction()
     t.note(note)
     self._storage.tpc_begin(t)
     oids = self._storage.undo(tid, t)
     self._storage.tpc_vote(t)
     self._storage.tpc_finish(t)
     return oids
开发者ID:grodniewicz,项目名称:oship,代码行数:10,代码来源:TransactionalUndoStorage.py

示例4: checkCreationUndoneGetTid

# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import note [as 别名]
 def checkCreationUndoneGetTid(self):
     # create an object
     oid = self._storage.new_oid()
     self._dostore(oid, data=MinPO(23))
     # undo its creation
     info = self._storage.undoInfo()
     tid = info[0]['id']
     t = Transaction()
     t.note('undo1')
     self._begin_undos_vote(t, tid)
     self._storage.tpc_finish(t)
     # Check that calling getTid on an uncreated object raises a KeyError
     # The current version of FileStorage fails this test
     self.assertRaises(KeyError, self._storage.getTid, oid)
开发者ID:agroszer,项目名称:ZODB,代码行数:16,代码来源:TransactionalUndoStorage.py


注:本文中的transaction.Transaction.note方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。