diff --git a/tailbone/forms/core.py b/tailbone/forms/core.py index 5e079085..04633bbb 100644 --- a/tailbone/forms/core.py +++ b/tailbone/forms/core.py @@ -213,9 +213,17 @@ class CustomSchemaNode(SQLAlchemySchemaNode): excludes = [] if isinstance(prop, orm.RelationshipProperty): for next_prop in prop.mapper.iterate_properties: + + # don't include secondary relationships if isinstance(next_prop, orm.RelationshipProperty): excludes.append(next_prop.key) + # don't include fields of binary type + elif isinstance(next_prop, orm.ColumnProperty): + for column in next_prop.columns: + if isinstance(column.type, sa.LargeBinary): + excludes.append(next_prop.key) + if excludes: overrides['excludes'] = excludes