From f61482e426a6ca97c31a254647aa77f5419f31f3 Mon Sep 17 00:00:00 2001 From: "arnaud.morvan@camptocamp.com" Date: Fri, 20 Oct 2017 15:23:01 +0200 Subject: [PATCH] Allow SQLAlchemySchemaNode subclassing As we want relationship's nodes ceated with the same type as parent node. --- colanderalchemy/schema.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/colanderalchemy/schema.py b/colanderalchemy/schema.py index 4925e76..6ebe913 100644 --- a/colanderalchemy/schema.py +++ b/colanderalchemy/schema.py @@ -554,13 +554,13 @@ def get_schema_from_relationship(self, prop, overrides): # xToOne relationships. return SchemaNode(Mapping(), *children, **kwargs) - node = SQLAlchemySchemaNode(class_, - name=name, - includes=includes, - excludes=excludes, - overrides=rel_overrides, - missing=missing, - parents_=self.parents_ + [self.class_]) + node = self.__class__(class_, + name=name, + includes=includes, + excludes=excludes, + overrides=rel_overrides, + missing=missing, + parents_=self.parents_ + [self.class_]) if prop.uselist: node = SchemaNode(Sequence(), node, **kwargs)