Most databases allow ordinal numbers as expressions in order by clauses, some even in group by clauses. And in earlier versions of SQLAlchemy it had in fact been possible to express these as integers, e.g. query.order_by(1, 3, desc(2)).

However, in version 0.7.1 this yields an "SQL expression object or string expected" error. To make use of this feature you now need to write query.order_by('1', '3', desc('2')) which is not so readable and convenient as the above. Has this been changed by intent?

I know, using ordinals has some drawbacks and may be considered a bad habit, but they can still be useful in some situations. E.g. it makes it possible to decorate arbitrary queries of the same structure for use in an autosuggest AJAX controller with an "order_by(1)".

-- Christoph

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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.

Reply via email to