Thank you for the nice solution, I have now modified my table to
reflect more closely
my situation and receiving an "overcorrellated" error.
Is there a way to pass correlate paramater to the "has" expression or
at the top level?
Modified example below:
btable = Table ('btable', metadata,
Column('id', Integer, ForeignKey('atable.id'),
primary_key=True),
Column('parent_id', Integer, ForeignKey('atable.id')),
Column('value', String)
)
class B(A):
pass
mapper(B, btable,
inherits=A,
inherit_condition=(btable.c.id == atable.c.id),
properties={'a':relation(A,
primaryjoin=(btable.c.parent_id==atable.c.id))})
session = Session()
print session.query(B).filter(B.a.has(A.name == 'boo'))
sqlalchemy.exceptions.InvalidRequestError: Select statement 'SELECT 1
FROM btable, atable
WHERE btable.parent_id = atable.id AND atable.name = :atable_name_1'
is overcorrelated; returned no 'from' clauses
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
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
-~----------~----~----~----~------~----~------~--~---