It is working! Thanks for all of the help.

Using Declarative methodology became the better way for me to
understand. Here are the basic parts:



class Item_alt(DeclarativeBase):
    __tablename__ = 'item_alt'
    id = Column(Integer, autoincrement=True, primary_key=True)
    bank_id = Column(Integer,ForeignKey('bank.id'))
    account = Column(Integer)
    customer = Column(String(30))
    alert    = Column(Integer, ForeignKey('alert.alert_nm'))
    run_dt   = Column(Date)
    item_tp  = Column(String(16))
    action   = Column(String(10), nullable=False)
    act_dt   = Column(Date)
    ckd_by   = Column(String(16))
    sent_to  = Column(String(16))
    note     = Column(String(80))
    item_nm  = Column(Integer)
    seq      = Column(String(20))
    r_desc   = Column(String(508))
    item_id = Column(Integer)
    ForeignKeyConstraint(['bank_id', 'alert'], ['alert.bank_id',
'alert.alert_nm'])


class Alert(DeclarativeBase):
                __tablename__ = 'alert'
                id = Column(Integer, autoincrement=True, primary_key=True)
                bank_id = Column(Integer, ForeignKey('bank.id'))
                alert_nm = Column(Integer, ForeignKey('item_alt.alert'))
                alert_tp = Column(Unicode(8))
                r_desc = Column(Unicode(50))
                r_exp  = Column(Unicode(100))
                sh_desc = Column(Unicode(30))
                ForeignKeyConstraint(['bank_id', 'alert_nm'], 
['item_alt.bank_id',
'item_alt.alert'])

********  Note: Line below is in models and follows all table class
listings. This insures all Classes are loaded before referencing
tables and columns  *****

Item_alt.alert_desc = relation(Alert, primaryjoin=and_
(Item_alt.bank_id == Alert.bank_id, Item_alt.alert==Alert.alert_nm))

Line in root controller that loads the field values;
        rows = [{'cell': [str(item_alt.account), str
(item_alt.item_nm),
            item_alt.seq, str(item_alt.action), item_alt.act_dt,
item_alt.ckd_by, item_alt.sent_to, \
            item_alt.alert_desc.sh_desc ]\
            ,'id':str(item_alt.id)} for item_alt in item_alts]

Hope this helps someone else.
-- 
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