So I'm happily developing a CherryPy-SqlObject-Cheetah application when i decide that I should really be using some more SqlObject features.  Namely ForeignKeys and SingleJoins. 

After destroying my application, I wrote a simple test case.....hopefully someone can take a look at it and tell me what I'm doing wrong.


from sqlobject import *

class Wstore(SQLObject):
    companyId = StringCol(default=None, alternateID=True, length=60)
    companyName = StringCol(default=None)
    specialSearchR = SingleJoin('SpecialSearch')

class SpecialSearch(SQLObject):
    companyId = ForeignKey('Wstore', alternateID=True)
    secondStageMatch = StringCol(default=None)
connection = connectionForURI("mysql://root:password@localhost/testdb")
sqlhub.processConnection = connection

Wstore._connection.debug = True
SpecialSearch._connection.debug = True

", companyName="The Company")
y=SpecialSearch(, secondStageMatch="foo")



So my first question is the line
 y=SpecialSearch(, secondStageMatch="foo")

That line seems to work, but I would have expected ForeignKeys to work more like
y=SpecialSearch(companyId=x, secondStageMatch="foo")

After all it's a foreign key to the object right?

My second questions is the line
...this doesn't work at all.  I would have expected it to to return what I just stored in y.

Any idea why it doesn't work?