From f26f42427f6f36090bc923a41398c90b4526c626 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 19 Oct 2018 21:17:50 -0500 Subject: [PATCH] Don't include LargeBinary properties in default colander schema actually, exclude any found in secondary properties...i.e. from relationship --- tailbone/forms/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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