Re: [sqlalchemy] order_by column in adjoining table

2013-07-26 Thread Michael Bayer
oh that should be mapper(TrafficInput, sel, non_primary=True) On Jul 26, 2013, at 10:41 AM, Michael Bayer wrote: > you'd need to make a relationship() that explicitly joins out among all four > tables so that the .Time column is available. To accomplish that you'd > probably want to make a n

Re: [sqlalchemy] order_by column in adjoining table

2013-07-26 Thread Michael Bayer
you'd need to make a relationship() that explicitly joins out among all four tables so that the .Time column is available. To accomplish that you'd probably want to make a non primary mapper to join to, it would look something like this: sel = select([TrafficInput, Traffic.Time]).sele

[sqlalchemy] order_by column in adjoining table

2013-07-26 Thread Andrew S
Given the following classes/tables: class TagList(Base): TagID = Column(Integer, primary_key=True) trafficInputs = relationship('TrafficInput', secondary='TagCaseLink', order_by='Traffic.Time') class TagCaseLink(Base): TagID = Column(Integer, ForeignKey('TagList.TagID'), primary_key=T