I can't really point at your problem, sorry. But I have a similar
script to fill my ZODB which works for me. You might want to try to
experiment with this / modify your script ...
# -*- coding: utf-8 -*-
from ZODB import FileStorage, DB
fs = FileStorage.FileStorage('/home/reuleaux/z3/Data.fs')
db = DB(fs)
root = con.root()
On Wed, Apr 05, 2006 at 10:33:55AM +0000, Reinhold Strobl wrote:
> I have got two problems, which are related:
> 1. How do get a reference to the root object of the ZODB everywhere?
> I mean I have found a solution like something:
> db = zapi.getUtility(IDatabase)
> conn = db.open()
> root = conn.root()
> root['123'] = newbook
> But it does not acutally store the object in the database.
> I try to commit it, but
> won't work. I search instead for get_transaction(), but I didn't found it in
> Python 's lib directory.
> So, how do I save it???
> 2. How do I get (the current) transaction?
> Thanks a lot in advance!
> Zope3-users mailing list
Zope3-users mailing list