@@ -114,13 +114,6 @@ class Container(BaseNeo):
114114 class.__name__.lower()+'s' will be automatically
115115 defined to hold this child and will be
116116 initialized to an empty list.
117- :_multi_child_objects: Neo container objects that can be children
118- of this object. This attribute is used in
119- cases where the child can have multiple
120- parents of this type. An instance attribute
121- named class.__name__.lower()+'s' will be
122- automatically defined to hold this child and
123- will be initialized to an empty list.
124117 :_child_properties: Properties that return sub-children of a particular
125118 type. These properties must still be defined.
126119 This is mostly used for generate_diagram.
@@ -134,25 +127,17 @@ class Container(BaseNeo):
134127 have one parent of this type.
135128 :_container_child_objects: +
136129 :_data_child_objects:
137- :_child_objects: All child objects.
138- :_single_child_objects: + :_multi_child_objects:
130+ :_child_objects: All child objects. Same as :_single_child_objects:
139131 :_container_child_containers: The names of the container attributes
140132 used to store :_container_child_objects:
141133 :_data_child_containers: The names of the container attributes used
142134 to store :_data_child_objects:
143135 :_single_child_containers: The names of the container attributes used
144136 to store :_single_child_objects:
145- :_multi_child_containers: The names of the container attributes used
146- to store :_multi_child_objects:
147- :_child_containers: All child container attributes.
148- :_single_child_containers: +
149- :_multi_child_containers:
137+ :_child_containers: All child container attributes. Same as :_single_child_containers:
150138 :_single_children: All objects that are children of the current object
151139 where the child can only have one parent of
152140 this type.
153- :_multi_children: All objects that are children of the current object
154- where the child can have multiple parents of
155- this type.
156141 :data_children: All data objects that are children of
157142 the current object.
158143 :container_children: All container objects that are children of
@@ -186,15 +171,7 @@ class Container(BaseNeo):
186171 single parent, set its parent
187172 to be the current object.
188173
189- :create_many_to_many_relationship(**args): For children of the current
190- object that can have more
191- than one parent of this
192- type, put the current
193- object in the parent list.
194-
195- :create_relationship(**args): Combines
196- :create_many_to_one_relationship: and
197- :create_many_to_many_relationship:
174+ :create_relationship(**args): Same as :create_many_to_one_relationship:
198175
199176 :merge(**args): Annotations are merged based on the rules of
200177 :merge_annotations:. Child objects with the same name
@@ -218,8 +195,6 @@ class Container(BaseNeo):
218195 _container_child_objects = ()
219196 # Child objects that have data and have a single parent
220197 _data_child_objects = ()
221- # Child objects that can have multiple parents
222- _multi_child_objects = ()
223198 # Properties returning children of children [of children...]
224199 _child_properties = ()
225200 # Containers that are listed when pretty-printing
@@ -265,27 +240,19 @@ def _single_child_containers(self):
265240 return tuple ([_container_name (child ) for child in
266241 self ._single_child_objects ])
267242
268- @property
269- def _multi_child_containers (self ):
270- """
271- Containers for child objects that can have multiple parents.
272- """
273- return tuple ([_container_name (child ) for child in
274- self ._multi_child_objects ])
275-
276243 @property
277244 def _child_objects (self ):
278245 """
279246 All types for child objects.
280247 """
281- return self ._single_child_objects + self . _multi_child_objects
248+ return self ._single_child_objects
282249
283250 @property
284251 def _child_containers (self ):
285252 """
286253 All containers for child objects.
287254 """
288- return self ._single_child_containers + self . _multi_child_containers
255+ return self ._single_child_containers
289256
290257 @property
291258 def _single_children (self ):
@@ -296,15 +263,6 @@ def _single_children(self):
296263 self ._single_child_containers ]
297264 return tuple (sum (childs , []))
298265
299- @property
300- def _multi_children (self ):
301- """
302- All child objects that can have multiple parents.
303- """
304- childs = [list (getattr (self , attr )) for attr in
305- self ._multi_child_containers ]
306- return tuple (sum (childs , []))
307-
308266 @property
309267 def data_children (self ):
310268 """
@@ -322,8 +280,7 @@ def container_children(self):
322280 Not recursive.
323281 """
324282 childs = [list (getattr (self , attr )) for attr in
325- self ._container_child_containers +
326- self ._multi_child_containers ]
283+ self ._container_child_containers ]
327284 return tuple (sum (childs , []))
328285
329286 @property
@@ -475,31 +432,6 @@ def create_many_to_one_relationship(self, force=False, recursive=True):
475432 child .create_many_to_one_relationship (force = force ,
476433 recursive = True )
477434
478- def create_many_to_many_relationship (self , append = True , recursive = True ):
479- """
480- For children of the current object that can have more than one parent
481- of this type, put the current object in the parent list.
482-
483- If append is True add it to the list, otherwise overwrite the list.
484- If recursive is True descend into child objects and create
485- relationships there
486- """
487- parent_name = _container_name (self .__class__ .__name__ )
488- for child in self ._multi_children :
489- if not hasattr (child , parent_name ):
490- continue
491- if append :
492- target = getattr (child , parent_name )
493- if self not in target :
494- target .append (self )
495- continue
496- setattr (child , parent_name , [self ])
497-
498- if recursive :
499- for child in self .container_children :
500- child .create_many_to_many_relationship (append = append ,
501- recursive = True )
502-
503435 def create_relationship (self , force = False , append = True , recursive = True ):
504436 """
505437 For each child of the current object that can only have a single
@@ -517,7 +449,6 @@ def create_relationship(self, force=False, append=True, recursive=True):
517449 relationships there
518450 """
519451 self .create_many_to_one_relationship (force = force , recursive = False )
520- self .create_many_to_many_relationship (append = append , recursive = False )
521452 if recursive :
522453 for child in self .container_children :
523454 child .create_relationship (force = force , append = append ,
@@ -565,8 +496,7 @@ def merge(self, other):
565496 after the merge operation and should not be used further.
566497 """
567498 # merge containers with the same name
568- for container in (self ._container_child_containers +
569- self ._multi_child_containers ):
499+ for container in self ._container_child_containers :
570500 lookup = {obj .name : obj for obj in getattr (self , container )}
571501 ids = [id (obj ) for obj in getattr (self , container )]
572502 for obj in getattr (other , container ):
0 commit comments