Add 'selectin' as a supported lazy relationship attribute

_load_one_to_manys() needs to not automatically load
relationships of type 'selectin'. Required in order to
support selectin DB load strategy in neutron tree.

Change-Id: Ib4e5f2ac2153015e3b6cc82a516b664d370e92d8
Related-bug: #2067770
This commit is contained in:
Brian Haley 2024-05-31 17:31:49 -04:00
parent 232f6128d5
commit f122525cda

View File

@ -330,7 +330,8 @@ def _load_one_to_manys(session):
# identity map and not emit SELECT. Otherwise, we are still
# local in the transaction so a normal SELECT load will work fine.
for relationship_attr in state.mapper.relationships:
if relationship_attr.lazy not in ('joined', 'subquery'):
if relationship_attr.lazy not in ('joined', 'subquery',
'selectin'):
# we only want to automatically load relationships that would
# automatically load during a lookup operation
continue