Hi

I am trying to create two tables linked by a simple one-to-many
relationship. Following the David's advice (
http://groups.google.com/group/turbogears/browse_thread/thread/ea7da1151d9f881d
) I was able to make SQLAlchemy link two classes, but I can't make it
actually create tables with the ForeignKeys. Whenever I am trying to
do it (already on the metadata.drop_all step) I get
----------------
hema.py", line 845, in column
    "foreign key" % tname)
sqlalchemy.exc.NoReferencedTableError: Could not find table
'worpairtopics' with
 which to generate a foreign key
----------------

So it fails to create a foreign key to the non-existing table. I don't
mind creating tables one by one, but can't get how to do that
correctly. Naive commenting the second class out during the first
create_all call didn't help - I still get the same error even if the
referenced table already exists (I think). I guess I am missing
something very basic. Please help.

Here is my very simple model. It is just a set of WordPairs belonging
to WordPairTopic's -  http://paste.turbogears.org/paste/25578

And here is my DB initialization script that fails (modeled closely
after Wiki20 tutorial) - http://paste.turbogears.org/paste/25579

Please, help. It should be something very simple for anybody who has
ever created linked classes in TG2 - SQLAlchemy.

Best regards,
Artem.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to