MCPcopy Create free account
hub / github.com/scanny/python-pptx / add_rel

Method add_rel

src/pptx/opc/oxml.py:131–137  ·  view source on GitHub ↗

Add a child ` ` element with attributes set as specified.

(
        self, rId: str, reltype: str, target: str, is_external: bool = False
    )

Source from the content-addressed store, hash-verified

129 relationship = ZeroOrMore("pr:Relationship")
130
131 def add_rel(
132 self, rId: str, reltype: str, target: str, is_external: bool = False
133 ) -> CT_Relationship:
134 """Add a child `<Relationship>` element with attributes set as specified."""
135 target_mode = RTM.EXTERNAL if is_external else RTM.INTERNAL
136 relationship = CT_Relationship.new(rId, reltype, target, target_mode)
137 return self._insert_relationship(relationship)
138
139 @classmethod
140 def new(cls) -> CT_Relationships:

Callers 2

xmlMethod · 0.80

Calls 1

newMethod · 0.45