[ZODB-Dev] Error message with simple ZODB usage

kw kw_odonian at yahoo.com
Mon Oct 25 18:10:26 EDT 2004


I'm new to the ZOZODBnd am writing some simple code to
learn how to use it; when I try to add and then commit
my persistent container, I get the message 

No handlers could be found for logger
"ZOZODBiFileStorage

The testing code is below - and if there are mistakes
or breaches of ZOZODBlegance, corrections are more
than welcome.  The "No handlers..." message appears
when I use the "adaddBobargument.



#!/ususrin/python

"""
Testing ZOZODBnd persistence with a simple example.
"""

import sys
sys.path.append('/web/ZoZopeX1/lib/python/')

import ZOZODBimport persistent

class Person(persistent.Persistent):

    def __ininit(self):
        self._type = "Human"

class Man(Person):

    def __ininit(self, name):
        Person.__ininit(self)
        self._name = name
        self._reason_for_being = "eat, sleep, work."

    def __rerepr(self):
        out = "My name is " + ststrelf._name) + " and
my raraison'etre is " + s\
tr(self._reason_for_being)
        return out

class PePeopleDirectoryersistent.Persistent):

    def __ininit(self):
        self._directory = []

    def adaddPersonelf, person):
        self._directory.append(person)
        self._p_changed = 1

    def __rerepr(self):
        out = ""
        for person in self._directory:
            out += ststrerson)
        return out

if __name__ == "__main__": 
    import transaction

    if "ininitin sys.arargv:2]:
        db =
ZOZODBB(ZOZODBiFileStorageiFileStoragetest_people.fsfs
create=1))
        root = db.open().root()
        root['people'] = PePeopleDirectory
        transaction.commit()

    if "adaddBobin sys.arargv:2]:
        db =
ZOZODBB(ZOZODBiFileStorageiFileStoragetest_people.fsfs)
        people_didir db.open().root()['people']
        Bob = Man("Bob")
        people_didirdaddPersonob)
        transaction.commit()

    if "show" in sys.arargv:2]:
        db =
ZOZODBB(ZOZODBiFileStorageiFileStoragetest_people.fsfs)
        people_didir db.open().root()['people']
        print people_didir


	
		
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail


More information about the ZODB-Dev mailing list