While working on the Postgres integration, I've stumbled across a
problem that's not making any sense. The attribute _mk_klass is not
being set in my middlekit objects. Line 237 of MiddleObject says the
attibute error means the model wasn't loaded. The demo below proves it
was, as it first makes a change to an existing middle kit object. It
is onlly when I create a brand new object and add it to the store that
_mk_klass is not defined. If I understand the way things work, loading
a model creates many instances of Klass, each of which modifies the
Python class definition as it loads, adding the _mk_klass attribute.
So it sounds like the class definition of 'Team' below is not getting
that attibute added for some reason. Can anyone shed some light on
The output from sample code below:
Traceback (most recent call last):
File "testWritingMiddlekit.py", line 12, in ?
line 141, in add
File "./MiddleKit/Run/MiddleObject.py", line 242, in
File "./MiddleKit/Run/MiddleObject.py", line 237, in klass
AttributeError: Team instance has no attribute '_mk_klass'
Code that produced this:
from Store import store
from Team import Team
aTeam = store.fetchObjectsOfClass("Team", clauses="where teamID=2")
print "Original name:" + aTeam.name()
newTeam = Team()
Kevin Dahlhausen 'Do' or 'do not.' There is no 'Try.'
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more