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 =
On Feb 28, 2012, at 9:40 AM, naktinis wrote:
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 ==
I should have pointed out that I got a NoSuchColumnError because of
anon_1.anon_2. There is no column anon_2 in any of the tables. It's
just an alias name of a derived table.
Is table_name_1.table_name_2 supposed to mean anything?
On Tuesday, February 28, 2012 5:53:42 PM UTC+2, Michael Bayer
it appears here the anon_2 is a label being given to your otherwise unnamed
FirstThing.moved_by.any() call, which is a subquery.
you're not showing me the full query being rendered but I would imagine the
important bits are:
SELECT anon_1.anon_2 AS anon_1_anon_2 FROM
(SELECT EXISTS (...)
Here's a test which generates essentially the same form and runs fine, I'll try
to simulate more of exactly what you're doing. Or if you had a real test case
ready to go, would save me a ton of time.
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import
OK it's another limit + joinedload - subquery targeting issue, so this is
http://www.sqlalchemy.org/trac/ticket/2419 and workaround for now is use
subqueryload_all() instead of joinedload_all() for this specific query.
On Feb 28, 2012, at 11:43 AM, Michael Bayer wrote:
Here's a test
Cool! Thanks so much! I'll give the workaround a try.
Yes, now I see - anon_2 was a column name, not a table name.
On Tuesday, February 28, 2012 6:54:42 PM UTC+2, Michael Bayer wrote:
OK it's another limit + joinedload - subquery targeting issue, so this is