[Sqlalchemy-tickets] Issue #3277: One-to-one mapping issues extra query when accessing parent_obj.c
Brought to you by:
zzzeek
|
From: Priit L. <iss...@bi...> - 2014-12-19 08:46:08
|
New issue 3277: One-to-one mapping issues extra query when accessing parent_obj.child.parent_obj https://bitbucket.org/zzzeek/sqlalchemy/issue/3277/one-to-one-mapping-issues-extra-query-when Priit Laes: We've been investigating an issue where we have a one-to-one relationship between A and B, where A->B is lazy=joined relationship. When querying A, both A and its child B are fetched, but when accessing A.B.A via (I even tried setting backref lazy='joined' to backref) it still issues another query. Eventual workaround/fix was to use options(contains_eager('b.a')) which also uses cleaner query. Now there's also with NULL check when passing nested path to contains_eager, but I'm not sure whether this is user or orm responsibility ;) |