I use PostgreSQL 8.1 , TG 0.9a5
In the tutorial:
http://trac.turbogears.org/turbogears/wiki/IntroductionToWidgets
data model: ( )
class Player(SQLObject):
...
team = ForeignKey('Team')
class Team(SQLObject):
...
players = MultipleJoin('Player')
when I create the database using "tg-admin sql create" ,I obtain the following
mistake:
=========
...
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py",
line 524, in createTable
self.query(self.createTableSQL(soClass))
...
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py",
line 297, in _executeRetry
return cursor.execute(query)
psycopg.ProgrammingError: ERROR: no existe la relaci??n ?<<team?>>
CREATE TABLE player (
id SERIAL PRIMARY KEY,
name VARCHAR(40) NOT NULL UNIQUE,
birthdate DATE NOT NULL,
team_id INT, CONSTRAINT team_id_exists FOREIGN KEY (team_id) REFERENCES
team (id) ,
points INT
)
=============
It's because team not exist at the creation of Player ... so, I create first
Team and before create Player by hand...
It's an alphabetical order problem?
--
Marcelo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---