Commit d3008d85 authored by Luca Barbato's avatar Luca Barbato

sqla: consider any kind of relation in InlineModelConverter

parent eb735767
...@@ -538,7 +538,7 @@ class InlineModelConverter(InlineModelConverterBase): ...@@ -538,7 +538,7 @@ class InlineModelConverter(InlineModelConverterBase):
reverse_prop = None reverse_prop = None
for prop in target_mapper.iterate_properties: for prop in target_mapper.iterate_properties:
if hasattr(prop, 'direction') and prop.direction.name == 'MANYTOONE': if hasattr(prop, 'direction'):
if issubclass(model, prop.mapper.class_): if issubclass(model, prop.mapper.class_):
reverse_prop = prop reverse_prop = prop
break break
...@@ -549,7 +549,7 @@ class InlineModelConverter(InlineModelConverterBase): ...@@ -549,7 +549,7 @@ class InlineModelConverter(InlineModelConverterBase):
forward_prop = None forward_prop = None
for prop in mapper.iterate_properties: for prop in mapper.iterate_properties:
if hasattr(prop, 'direction') and prop.direction.name == 'ONETOMANY': if hasattr(prop, 'direction'):
if prop.mapper.class_ == target_mapper.class_: if prop.mapper.class_ == target_mapper.class_:
forward_prop = prop forward_prop = prop
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment