On Sep 19, 2010, at 1:11 AM, cd34 wrote: > class Block(Base): __tablename__ = 'm_block' > > id = Column(mysql.BIGINT(20, unsigned=True), primary_key=True, > autoincrement > =True) > name = Column(Unicode(80)) > #elements = relation('Element', secondary=Block_element) > elements = relation('Element', secondary=Block_element, > order_by='m_block_element.sorttree') > > results in AttributeError: 'Table' object has no attribute 'sorttree' > > If I reference order_by=Block_element.sorttree, paster crashes with > the same error.
order_by='somestr' with declarative means the string is a Python eval. So if you wanted to put the name of the Table here, its m_block_element.c.sorttree. Would be easier to just say order_by=Block_element.c.sorttree though. > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.