[Pyobjfs-users] Problems running tutorial
Status: Beta
Brought to you by:
mathematician
|
From: Stephen R. F. <fi...@mo...> - 2002-02-22 16:10:00
|
I was playing around with oops, attempting to follow the tutorial: http://pyobjfs.sourceforge.net/tutorial.html I am using Python 2.2 on a Redhat 7.2 Linux install. Oops 0.9.1 My first snag in the Medical patient example was Date, which Python said wasn't defined. I checked the API and noticed there was no Date type (or Class, rather) so I took a guess and changed it to Data() Then I got a complaint about Obj.__init__ >>> patient_db.append(Patient("Dan", "Parisien", (5,5,1980))) Traceback (most recent call last): File "<pyshell#48>", line 1, in ? patient_db.append(Patient("Dan", "Parisien", (5,5,1980))) File "<pyshell#46>", line 8, in __init__ Obj.__init__(**kwargs) # OOPS uses keyword arguments TypeError: unbound method __init__() must be called with Obj instance as first argument (got nothing instead) hmmm... okay, so I took a stab at this perhaps being Obj.__init__(self, **kwargs) >>> patient_db.append(Patient("Dan", "Parisien", (5,5,1980))) Traceback (most recent call last): File "<pyshell#51>", line 1, in ? patient_db.append(Patient("Dan", "Parisien", (5,5,1980))) File "/usr/lib/python2.2/site-packages/oops/core.py", line 1372, in append value.__moveto__(self.__database__, self.__path__+(key,), self) File "/usr/lib/python2.2/site-packages/oops/core.py", line 615, in __moveto__ Node.__moveto__(self, database, path=(), parent=None) File "/usr/lib/python2.2/site-packages/oops/core.py", line 216, in __moveto__ getattr(self, key).__moveto__(database, path+(key,), self) File "/usr/lib/python2.2/site-packages/oops/core.py", line 1173, in __moveto__ for key in list.__iter__(self): AttributeError: type object 'list' has no attribute '__iter__' Some sort of problem with list? The tests seemed to run okay: [fig@localhost oops-0.9.1]$ python2 test.py ............ ---------------------------------------------------------------------- Ran 12 tests in 26.973s OK Do you have any advice? -Stephen |