Federico Caselli <cfederic...@gmail.com> writes: > Also you may not need the col_by_name at all for order_by, since you can > pass the string in order_by directly: > https://docs.sqlalchemy.org/en/20/tutorial/data_select.html#tutorial-order-by-label > This case is still not supported, since doing "query.order_by('firstname')" > raises "column not found".
Yes, but in rare cases I exploited its ability of findind a column not "exposed" in the select, belonging to one of the joined tables, for example to have a stable sort. > (ps: github discussions should be preferred to share code snippets) Sorry, note taken. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/87v8ft9ny3.fsf%40metapensiero.it.