Em Quarta 17 Maio 2006 12:16, Ed Singleton escreveu:
> On 5/16/06, Matthew Bevan <[EMAIL PROTECTED]> wrote:
> > Try:
> > > class Page(SQLObject):
> > >     parent_page = ForeignKey('Page')
> > >     child_pages = MultipleJoin('Page', joinColumn="parent_page_id")
> >
> > Also useful, if page order is important, is adding a orderBy to
> > child_pages.
>
> This worked for me.
>
> It's a bit too much magic for my taste, because I don't have a
> parent_page_id column and I couldn't find any documentation anywhere
> that suggests that name would be created (I would have expected
> parent_pageID or something).

Take a look at what is generated with "ForeignKey".  It creates a column named 
"<the_name_you_gave>_id".  Then, in the MultipleJoin, you were joining with 
this column.

It's in the docs, even though it might not be obvious (but hey, you're the one 
that made the join with the foreign key instead of the primary key...).

-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to