On Nov 21, 2007 11:34 AM, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 21, 2007 at 11:07:01AM +0100, Bert Wesarg wrote:
> > Note, the only difference is the name of the second table. but in the
> > second case the table 'bla_person' is not created.
>
>    SQLObject sorts RelatedJoins tables alphabetically to avoid creating
> the same intermediate table twice... and doesn't found any RealatedJoin in
> Bla table... it doesn't look into Person because Person comes after Bla,
> where in the first your example Person comes before Role.
>    RelatedJoins have to be mutual:
>
> class Person(SQLObject):
>     name       = StringCol()
>     roles      = RelatedJoin('Bla')
>
> class Bla(SQLObject):
>     name = StringCol()
>     persons = RelatedJoin('Person')
>
Thank you very much for your explanation. Is there an other 'join' I
should use for the case, where I only want in one class to get a
'addRole' function, but not a 'addPerson' function?

And as a second question, how to get something like a dependency tree?
I use currently something like this:

class Job(SQLObject):
    cmd = StringCol()
    dependsOn = ReletatedJoin('Job',
        otherColumn        = 'dependent_id',
        addRemoveName      = 'Dependency')

Thank you.

Bert


> Oleg.
> --
>      Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
>            Programmers don't die, they just GOSUB without RETURN.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> sqlobject-discuss mailing list
> sqlobject-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to