They both have to be subqueries because they can have where-statements. If select_from() is the normal way than I have to live with these additional select-from-constructions.
Do you have/know some example of how to use from_statement()? Because I tried it with from_statement() but it doesn't work. combined_query = session.query(existing_query).join(additional_query).subquery() session.query(TableOne).from_statement(combined_query.statement) --> raises NoSuchColumnError: "Could not locate column in row for column 'table_one.id' combined_query = session.query(existing_query).join(additional_query).subquery() session.query(existing_query).from_statement(combined_query.statement) --> returns a llist of values (not TableOne objects) By the way is there a way to retrieve the given class from a query object. >From example: If a method create a Query object like this: query = session.query(TableOne, TableTwo).filter(...) and returns 'query'. How can I find out that the query was created with the objects TableOne and TableTwo ? -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.
