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

