Fix bug when locating association proxy column

This commit is contained in:
Lance Edgar 2018-01-15 15:11:12 -06:00
parent c996bf47ea
commit f9d1d34763

View file

@ -87,9 +87,10 @@ def get_association_proxy_column(inspector, field):
""" """
proxy_target = get_association_proxy_target(inspector, field) proxy_target = get_association_proxy_target(inspector, field)
if proxy_target: if proxy_target:
prop = proxy_target.mapper.get_property(field) if proxy_target.mapper.has_property(field):
if isinstance(prop, orm.ColumnProperty) and isinstance(prop.columns[0], sa.Column): prop = proxy_target.mapper.get_property(field)
return prop if isinstance(prop, orm.ColumnProperty) and isinstance(prop.columns[0], sa.Column):
return prop
class CustomSchemaNode(SQLAlchemySchemaNode): class CustomSchemaNode(SQLAlchemySchemaNode):