I have a handful of queries that are fairly complex. For these, I need to support both
SELECT object.* ( for full records ) SELECT object.id ( for caching of collection ids + COUNT operations ) My current approach is really dirty. three functions wrap a "core" generator, which does all the heavy work. They just pass in the kwargs. I don't really like this, because the 'core' starts like this: if ids_only or for_count: query = dbSession.query( Object.id ) else: query = dbSession.query( Object ) I generally don't like writing things that behave so differently. Is it possible to query Object, build all the joins/filters against that, and then just edit the query to only select the 'id' afterwards ? -- 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 post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.