We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ce2e1b commit 8310035Copy full SHA for 8310035
1 file changed
odml/section.py
@@ -582,3 +582,17 @@ def reorder(self, new_index):
582
"Section has no parent, cannot reorder in parent list.")
583
584
return self._reorder(self.parent.sections, new_index)
585
+
586
+ def create_section(self, name, type="undefined", oid=None):
587
+ """
588
+ Creates a new subsection that is a child of this section.
589
590
+ :param name: The name of the section to create.
591
+ :param type: The type of the section.
592
+ :param oid: object id, UUID string as specified in RFC 4122. If no id
593
+ is provided, an id will be generated and assigned.
594
+ :return: The new section.
595
596
+ sec = BaseSection(name=name, type=type, oid=oid)
597
+ sec.parent = self
598
+ return sec
0 commit comments