diff --git a/entities.py b/entities.py index ad28c783ec1646990cac9bc64032335c5eecb5d9_ZW50aXRpZXMucHk=..7a8a295a22861c0cd1638a43e37efc569ef9a478_ZW50aXRpZXMucHk= 100644 --- a/entities.py +++ b/entities.py @@ -156,6 +156,8 @@ __abstract__ = True __select__ = partial_relation_possible() rtype, role = None, 'object' # relation between the clone and the original. + skiprtypes = () + skipetypes = () def clone_into(self, clone): """Recursivily clone the container graph of this entity into `clone`.""" @@ -164,7 +166,9 @@ clone.cw_etype, self.entity.cw_etype) clone.copy_relations(self.entity.eid) clones = {self.entity: clone} - for child, (rtype, role), parent in composite_entities_graph(self.entity): + graph = composite_entities_graph(self.entity, skiprtypes=self.skiprtypes, + skipetypes=self.skipetypes) + for child, (rtype, role), parent in graph: rel = rtype if role == 'subject' else 'reverse_' + rtype kwargs = {rel: clones[parent]} clone = clones.get(child)