[sqlalchemy] Reflect class sorting based on __mapper_args__['order_by']

2013-02-15 Thread Moritz Schlarb
Hi there, I'd like to be able to run sorted() on a list of model objects without class-specific code which sorts based on what's specified in __mapper_args__['order_by']. To do that, I would add __lt__(), __le__(), __gt__(), and/or __ge__() to the declarative base class, which try to get the

Re: [sqlalchemy] Reflect class sorting based on __mapper_args__['order_by']

2013-02-15 Thread Michael Bayer
On Feb 15, 2013, at 5:23 AM, Moritz Schlarb mosch...@metalabs.de wrote: Hi there, I'd like to be able to run sorted() on a list of model objects without class-specific code which sorts based on what's specified in __mapper_args__['order_by']. To do that, I would add __lt__(),