ponyorm / pony

Pony Object Relational Mapper
Apache License 2.0
3.63k stars 245 forks source link

order_by cannot be called with generic callable #687

Open yggdr opened 1 year ago

yggdr commented 1 year ago

order_by checks if its first argument is an instance of types.FunctionType. This makes it impossible to use it with general callables like methods, instances with __call__, operator.itemgetter(-1) etc. It should therefore changed to check for if callable(args[0]).