Thank you so much!  I got the SingleJoin to work following your instructions.  I'm still confused as to why I need to specify the joinColumn though....  (besides the obvious reason that when I do it, and capitalize everything correctly it works....) 

I can't find any examples of SingleJoins on the web, but the examples I've seen of MultipleJoins don't specify the joinColumn.  Is this somehow a unique requirement of SingleJoins?

A tangent....has there been any thought to allowing comments directly in the documentation on the web or somehow wikifying the docs?  I'd be glad to share the things I learn as I puzzle through the docs, but I don't have an easy way to do it now.

Thanks again,

P.S.  Any idea when 0.8 will be officially released?  How stable is the code that's now in the repository? 

On 2/26/06, Oleg Broytmann <phd@phd.pp.ru> wrote:
On Mon, Feb 20, 2006 at 11:55:38PM -0300, Sam's Lists wrote:
> #!/usr/bin/python
> 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
> Wstore.createTable()
> SpecialSearch.createTable()
> x=Wstore(companyId="TheCompany ", companyName="The Company")
> y=SpecialSearch(companyId=x.id , secondStageMatch="foo")
> z=x.SpecialSearchR
> ---------
> So my first question is the line
>  y=SpecialSearch(companyId=x.id, secondStageMatch="foo")
> That line seems to work, but I would have expected ForeignKeys to work more
> like
> y=SpecialSearch(companyId=x, secondStageMatch="foo")

   This is fixed in the repository. Will be in SQLObject 0.8.

> My second questions is the line
> z=x.SpecialSearchR
> ...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?

   First, case msimatch:

>     specialSearchR = SingleJoin('SpecialSearch')

   Second, you've forgotten to name a column for join.

     Oleg Broytmann             http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
sqlobject-discuss mailing list