I ran into a problem with a rather unique query on SA 0.6.5 (reproducible on 0.7.1). The query eagerloads a collection, undefers a scalar-select column, orders on the latter, and applies a limit/ offset. To order by a scalar-select column without executing the subquery again, I have to apply a custom label on the select and use that in the order_by. The problem is that, when SA nests the query because of the limit/eagerload combo, it tacks on the order_by columns again, which fails since the custom label isn't valid by itself.
Here is a self-contained script to illustrate the problem: http://dl.dropbox.com/u/45702/deferred.py The problem, on SA 0.6.5, came down to line 2390 of sqlalchemy.orm.query.Query._compile_context. Is this a bug or is there a better way to do the above? Thanks. -- 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.
