我已经定义了一个名为“Contract”的Zodb持久化类。
class Contract(Persistent):
# list of all my orderbooks key'ed by timestamp
def __init__(self):
self.books= OOBTree.BTree()
当我在Zodb的第二个python应用程序中加载此类的实例时,我可以看到该类存在问题。导入行位于第二个应用程序中:
from persistent.list import PersistentList
from persistent import Persistent
from BTrees import OOBTree
这是运行时的输出:
<persistent broken __main__.Contract instance '\x00\x00\x00\x00\x00\x00\t\x17'>
如果我在同一个上下文中执行“print dir()”,我会看到进一步破碎的类。
['__Broken_Persistent__', '__Broken_initargs__', '__Broken_newargs__', '__Broken_state__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribut
e__', '__getnewargs__', '__getstate__', '__hash__', '__implemented__', '__init__', '__module__', '__name__', '__new__', '__providedBy__', '__provides__', '__reduce__', '_
_reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_p_activate', '_p_changed', '_p_deactivate', '_p_de
lattr', '_p_estimated_size', '_p_getattr', '_p_invalidate', '_p_jar', '_p_mtime', '_p_oid', '_p_serial', '_p_setattr', '_p_state', '_p_status', '_p_sticky']
合同因其他破损的课程而被打破吗?为什么即使导入也会导致Persistent断开。