[Sqlalchemy-tickets] Issue #4150: .contains fails with "chained" association proxies in 1.2 (zzzeek
Brought to you by:
zzzeek
From: dairiki N. <iss...@bi...> - 2018-01-02 21:59:34
|
New issue 4150: .contains fails with "chained" association proxies in 1.2 https://bitbucket.org/zzzeek/sqlalchemy/issues/4150/contains-fails-with-chained-association dairiki NA: The attached script fails with `sqlalchemy.exc.InvalidRequestError`: `contains() doesn't apply to a scalar endpoint; use ==` in SQLAlchemy==1.2. It works with SQLAlchemy==1.1.15 (and before). The crux here is: ``` #!python Team.events = association_proxy('eventteams', 'event') ``` where the proxied attribute is itself an association proxy: ``` #!python EventTeam.event = association_proxy('division', 'event') ``` In this case the expression `Team.events.contains(some_event)` is what elicits the exception. |