[Sqlalchemy-tickets] Issue #3960: Declarative backref not filtering by polymorphic identity (zzzeek
Brought to you by:
zzzeek
From: Mischa <iss...@bi...> - 2017-04-05 21:30:13
|
New issue 3960: Declarative backref not filtering by polymorphic identity https://bitbucket.org/zzzeek/sqlalchemy/issues/3960/declarative-backref-not-filtering-by Mischa: I am trying to declare a backref relationship between a related table and a single-table polymorphic subclass. I expect the relationship to filter by the polymorphic discriminator column when I select the relationship, but instead it selects ALL related rows, regardless of polymorphic discriminator identity. This is confusing, and does not appear to be documented in http://docs.sqlalchemy.org/en/latest/orm/extensions/declarative/inheritance.html#declarative-inheritance I think this is a common use case, but I see very little documentation in the declarative inheritance relationship documentation. Please let me know if I'm missing something. Attached is a test case that fails to discriminate when selecting the related rows via backref. SQL logs are at: https://0bin.net/paste/P2VTuIUsIDyZ9vw4#zItNB6zFxnNm1usjqzqflA4eJ+JqGELuUq8uIm2pf2i |