我最近收到了一个包含erp5数据库的ZODB文件(.fs)。我需要检索存储的数据,但我不知道数据库结构。
我需要的是一些代码行(如果可能)来收集“表”和“记录”存储在数据库中。
这就是我连接到数据库的方式。
from ZODB import FileStorage, DB
storage = FileStorage.FileStorage('D:\slappart88\srv\zodb\main.fs')
db = DB(storage)
conn = db.open()
root = conn.root()
fsi = storage.iterator()
print db
print conn
print root
print fsi
db.close()获取以下输出:
<ZODB.DB.DB object at 0x00000000028395C0>
<Connection at 02978128>
{'Application': <persistent broken OFS.Application.Application instance '\x00\x00\x00\x00\x00\x00\x00\x01'>}
<ZODB.FileStorage.FileStorage.FileIterator object at 0x0000000002978198>如果有任何帮助,我将不胜感激。
谢谢!
https://stackoverflow.com/questions/35066428
复制相似问题