On May 18, 2012, at 9:41 AM, Michael Bayer wrote:
>
>
>> nor sort_on columns in mapper
>
> order_by? OK, I'm not a huge fan of mapper order_by but we can come up with
> something on that....
the latest tip ensures that __mapper_args__ is not invoked until after the
table is reflected and available via __table__, so you can say:
class User(Base):
__tablename__ = 'users'
@declared_attr
def __mapper_args__(cls):
return {
"order_by":cls.__table__.c.name
}
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en.