[SQLObject] MulipleJoin select problem when upgrading
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Brian R. <br...@se...> - 2004-10-05 18:45:43
|
Hello:
I am currently upgrading from SQLObject .5 to .6. Everything has been
working fine until I ran into the problem below.
# Works if .5 but not in .6:
...
class foo(SQLObject):
name = StringCol()
foobar = MultipleJoin('foobar')
...
class foobar(SQLObject):
title = StringCol()
foo = ForeignKey('foo')
...
newbob = foo( name = 'bob')
newtitle = foobar(title = 'Programmer', foo = newbob)
# later:
................................
bob = STDtables.foo.select(' name = 'bob')[0]
...
if bob.foobar[0].title == 'Programmer':
print '000101010'
else:
print 'hello'
...
AttributeError: 'foo' object has no attribute 'foobar'
Was I doing something wrong in the first place? How do I get this to
work with .6?
Thanks in advance, Brian
|