[ZODB-Dev] confused... Zope/ZODB

Antony Higgs ahiggs@brookes.ac.uk
Wed, 12 Jun 2002 11:41:41 +0100


Hi

ok, i'm new to this Zope/ZODB and am a bit confused. ;-)

- ZODB comes with zope?

- You can do ZODB things from a Zope script (python) page?

- If so, I am having trouble doing anything with it. I have been working
through a tutorial which creates storage stores some info and then looks
to see what you have just stored.

create the storage and add info
----------------------
from ZODB import FileStorage, DB
storage = FileStorage.FileStorage('mydb.fs')
db = DB(storage)
connection = db.open()
root = connection.root()

root['employees'] = ['Mary','Jo','Bob']
get_transaction().commit()
----------------------

connect to DB and see what's in it
----------------------
from ZODB import FileStorage, DB
storage = FileStorage.FileStorage('mydb.fs')
db = DB(storage)
connection = db.open()
root = connection.root()

root.items()
----------------------

The first section of code gives a Zope error:

Error Type: ImportError
Error Value: import of "FileStorage" from "ZODB" is unauthorized


Am I on another planet with my thinking?


Thanks

John