Column "anon_1.anon_2" is generated in the following scenario:
dbsession.query(FirstThing, FirstThing.moved_by.any(User.id ==
user_id)).options(joinedload_all('some_property'))
query = query.join(SecondThing, SecondThing.first_thing_id == FirstThing.id)
query = query.order_by(OneThing.ordering_field).limit(count)
Also, it is important that both FirstThing and SecondThing polymorphically
inherit from Thing.
Effectively, query.all() generates a query like
SELECT ... anon_1.anon_2 AS anon_1_anon_2 ...
FROM
(SELECT first_thing.id AS first_thing.id, EXISTS (SELECT 1 FROM
first_thing_moves, users ...) AS anon_2
FROM thing JOIN first_thing ON ... JOIN (SELECT ... FROM thing JOIN
second_thing) AS anon_3 ON ... ORDER BY ... LIMIT ...) AS anon_1 ORDER BY
...
Why would "anon_1.anon_2" column be generated there - it is, I think, not
even a valid syntax?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/VmrpL96y64UJ.
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.