@@ -166,12 +166,9 @@ class Container(BaseNeo):
166166 object recursively that are of a
167167 particular class.
168168
169- :create_many_to_one_relationship(**args): For each child of the current
170- object that can only have a
171- single parent, set its parent
172- to be the current object.
173-
174- :create_relationship(**args): Same as :create_many_to_one_relationship:
169+ :create_relationship(**args): For each child of the current
170+ object, set its parent
171+ to be the current object.
175172
176173 :merge(**args): Annotations are merged based on the rules of
177174 :merge_annotations:. Child objects with the same name
@@ -209,7 +206,7 @@ def __init__(self, name=None, description=None, file_origin=None,
209206 file_origin = file_origin , ** annotations )
210207
211208 @property
212- def _single_child_objects (self ):
209+ def _child_objects (self ):
213210 """
214211 Child objects that have a single parent.
215212 """
@@ -233,34 +230,20 @@ def _data_child_containers(self):
233230 self ._data_child_objects ])
234231
235232 @property
236- def _single_child_containers (self ):
233+ def _child_containers (self ):
237234 """
238235 Containers for child objects with a single parent.
239236 """
240237 return tuple ([_container_name (child ) for child in
241- self ._single_child_objects ])
242-
243- @property
244- def _child_objects (self ):
245- """
246- All types for child objects.
247- """
248- return self ._single_child_objects
249-
250- @property
251- def _child_containers (self ):
252- """
253- All containers for child objects.
254- """
255- return self ._single_child_containers
238+ self ._child_objects ])
256239
257240 @property
258241 def _single_children (self ):
259242 """
260243 All child objects that can only have single parents.
261244 """
262245 childs = [list (getattr (self , attr )) for attr in
263- self ._single_child_containers ]
246+ self ._child_containers ]
264247 return tuple (sum (childs , []))
265248
266249 @property
@@ -405,18 +388,11 @@ def list_children_by_class(self, cls):
405388 objs .extend (getattr (child , container_name , []))
406389 return objs
407390
408- def create_many_to_one_relationship (self , force = False , recursive = True ):
391+ def create_relationship (self , force = False , recursive = True ):
409392 """
410393 For each child of the current object that can only have a single
411394 parent, set its parent to be the current object.
412-
413- Usage:
414- >>> a_block.create_many_to_one_relationship()
415- >>> a_block.create_many_to_one_relationship(force=True)
416-
417- If the current object is a :class:`Block`, you want to run
418- populate_RecordingChannel first, because this will create new objects
419- that this method will link up.
395+ For children of the current object, put the current object in the parent list.
420396
421397 If force is True overwrite any existing relationships
422398 If recursive is True descend into child objects and create
@@ -429,30 +405,7 @@ def create_many_to_one_relationship(self, force=False, recursive=True):
429405 setattr (child , parent_name , self )
430406 if recursive :
431407 for child in self .container_children :
432- child .create_many_to_one_relationship (force = force ,
433- recursive = True )
434-
435- def create_relationship (self , force = False , append = True , recursive = True ):
436- """
437- For each child of the current object that can only have a single
438- parent, set its parent to be the current object.
439- For children of the current object that can have more than one parent
440- of this type, put the current object in the parent list.
441-
442- If the current object is a :class:`Block`, you want to run
443- populate_RecordingChannel first, because this will create new objects
444- that this method will link up.
445-
446- If force is True overwrite any existing relationships
447- If append is True add it to the list, otherwise overwrite the list.
448- If recursive is True descend into child objects and create
449- relationships there
450- """
451- self .create_many_to_one_relationship (force = force , recursive = False )
452- if recursive :
453- for child in self .container_children :
454- child .create_relationship (force = force , append = append ,
455- recursive = True )
408+ child .create_relationship (force = force , recursive = True )
456409
457410 def __deepcopy__ (self , memo ):
458411 """
0 commit comments