InheritableSQLObject exception - am I doing something wrong, or is it a bug?
2007-03-01 03:11:20 GMT
Hello!
I'm having some difficulty with inheritance. Specifically, I'm
getting an AttributeError exception at line 348 of inheritance/
__init__.py (in InheritableSQLObject._create()) of SQLObject 0.8.
This happens when I try to instantiate my AND class, which inherits
from a class called Operator. Interestingly, in the DB, Operator's
table has a row, with id=1 and child_name=AND.
Here's the stack trace:
File "/Users/anseljh/pyple/src/pyple.py", line 279, in __main__
andtf = AND(params=[True, False])
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/sqlobject/
declarative.py", line 94, in _wrapper
return fn(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/sqlobject/main.py",
line 1231, in __init__
self._create(id, **kw)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/SQLObject-0.8.0-py2.4.egg/sqlobject/
inheritance/__init__.py", line 348, in _create
id = self._parent.id
AttributeError: 'Operator' object has no attribute 'id'
Here are the class definitions:
class Operator(InheritableSQLObject):
(Continue reading)





RSS Feed