Don't you need to use a RelatedJoin as it's a many to many relationship?
ahhh of course... it was late sorry
anoything that should be said is that you DO need the otherColumn attribute since SO will ignore it thinking it's a dup if you do
I add this to the wiki please enhance it.
http://trac.turbogears.org/turbogears/wiki/SQLObjectTreeLike
Ed
On 6/24/06, Jorge Vargas <[EMAIL PROTECTED]> wrote:
> On 5/16/06, Jorge Godoy <[EMAIL PROTECTED]> wrote:
>
> >
> > Em Terça 16 Maio 2006 19:18, Ed Singleton escreveu:
> > > I want to join a table with itself in the model definition.
> > >
> > > Something like:
> > >
> > > class Page(SQLObject):
> > > parent_page = ForeignKey('Page')
> > > child_pages = MultipleJoin('Page')
> > >
> > > but when I do, and I try to pull out the child pages I get the error:
> > >
> > > OperationalError: (1054, "Unknown column 'page_id' in 'where clause'")
> > >
> > > Any clues?
> >
> > Specify the "joinColumn" as "id".
>
>
> Jorge I'm doing that and it's not working for me I strip down my model to
>
> class Region(SQLObject):
> name = StringCol(alternateID=True)
> borders = MultipleJoin("Region",joinColumn='id')
>
> also try with borders_id
> tg-admin sql sql says:
> CREATE TABLE region (
> id INTEGER PRIMARY KEY,
> name TEXT NOT NULL UNIQUE
> );
>
> and tg-admin sql create gives no errors at all.
>
> any ideas?
> >
> --
>
> Jorge Godoy < [EMAIL PROTECTED]>
>
>
>
>
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

