Thanks for your help.

I am getting tangled in the SQLalchemy doc trying to get the correct
syntax for the following;

All tables have a bank_id field as the first field of the composite
foreign key. Therefore Alert has a constraint of 'bank_id, alert'. I
need to put this in SA as a foreign key on the Item_alt table :

select item_alt.field_display_list, alert.sh_desc
where alert.bank_id == item_alt.bank_id and alert.alert ==
item_alt.alert.

This is a large DB and I am the relational rules to eliminate
duplicate data. therefore there are many relationships. As I
understand now, I can attach a column name to a table class as below,
but how do I refer to the value of the field in the related table?

class item_alt(declarative):
    id = column()
    bank_id = Column()
    alert = column()
    ........
    alert_desc = relation(Alert, primaryjoin=bank_id == alert.bank_id
and alert == alert.alert)           Is the and correct?
    foreignKeyConstrant(['bank_id', 'alert'], ['alert.bank_id',
'alert.alert'])

this should not be hard. Suggestions?
-- 
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