On Fri, May 31, 2013 at 12:31 PM, Ladislav Lenart <lenart...@volny.cz>wrote:

> Hello.
>
> I've read the patch and the new documentation and i've learned about the
> existence of select_entity_from(). I was trying to say that the new
> documentation does not help me to understand the meaning / preferred usage
> of
> these constructs (i.e. select_from, select_entity_from and aliased). I
> simply
> don't understand when should I use which and why.
>
> I have already solved my original problem by replacing select_from() with
> add_entity() and join(). Take a look at older posts in this thread for more
> details if you're interested, though the original query is a bit more
> involved
> than the supplied regression.
>
> Ladislav Lenart
>

Sorry I rushed with the reply! I haven't carefully read your original post,
but concentrated on the patch as I was hoping it was relevant to my issue.
More importantly, I was misleading and wrong in trying to 'summarize' the
docs, stating there are new and old methods.

The examples in the patch say those two cases:

select_stmt = select([User]).where(User.id == 7)

q = session.query(User).select_entity_from(select_stmt)
user_from_select = aliased(User, select_stmt.alias())

should produce similar result, i.e. give you User entity from different
mapping then usual; whether select_from() should work as intended -
resulting cartesian product in docs example should be 'eliminated' by
further join.

Cheers,
a.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to