I'm using sqlite. Here's my model.py:
class Alpha(SQLObject):
betas = RelatedJoin('Beta')
gammas = MultipleJoin('Gamma')
class Beta(SQLObject):
alphas = RelatedJoin('Alpha')
class Gamma(SQLObject):
alpha = ForeignKey('Alpha')
And this is the output from tg-admin sql sql:
$ tg-admin sql sql
Using database URI sqlite:///home/matt/scratch/zoom/devdata.sqlite
CREATE TABLE alpha (
id INTEGER PRIMARY KEY
);
CREATE TABLE alpha_beta (
alpha_id INT NOT NULL,
beta_id INT NOT NULL
);;
CREATE TABLE beta (
id INTEGER PRIMARY KEY
);
;;
CREATE TABLE gamma (
id INTEGER PRIMARY KEY,
alpha_id INT CONSTRAINT alpha_id_exists REFERENCES alpha(id)
);
;;
Note that the alpha_beta table has no foreign keys! How do I force
them to exist? I noticed that if I manually create the table, then I
get them.
Hopefully I'm doing something really silly and there's an easy fix for
this.
Thanks for the help.
Matt
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---