I never used composite foreign key with declarative style so I can't
be of great help, but I think you need to also define secondaryjoin in
your relation.

If you want to try the classical definition method (look in model/
__init__.py), you can autoload your table adding manually two primary
keys:

t_alert = Table("Alert", metadata,
    Colum('bank_id',Integer,primary_key=True),
    Colum('alert',Integer,primary_key=True),
    autoload=True,
    autoload_with=engine)

Do the same for item_alt, then :

mapper(alert,t_alert)
mapper(item_alt,t_item_alt,properties={'alert_prop':relation(alert)})

Sqlalchemy should take care of everything (like foreign keys),
assuming they are correctly defined in your database.
-- 
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