Re: [SQLObject] weird SQLObject subclassing thing
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-05-26 15:49:08
|
ludwig zeininger wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > hi > > just upgraded from 0.5.2 to the svn version. > > code like this: > > class Sub(SQLObject): > ... > > class Person(Sub): > _fromDatabase = True At this point your Person class doesn't have a _connection attribute for some reason. I'm not sure exactly why. (Since Person._connection is None, and the class gets setup right away, you get this exception) > which used to work in 0.5.2, now produces: > > Traceback (most recent call last): > File "test.py", line 31, in ? > class Person(Sub): > File "/usr/lib/python2.3/site-packages/sqlobject/main.py", line 159, in > __new__ > newClass.addColumnsFromDatabase() > File "/usr/lib/python2.3/site-packages/sqlobject/main.py", line 460, in > addColumnsFromDatabase > for columnDef in cls._connection.columnsFromSchema(cls._table, cls): > AttributeError: 'NoneType' object has no attribute 'columnsFromSchema' -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |