MCPcopy Index your code
hub / github.com/python-openxml/python-docx / add_rel

Method add_rel

src/docx/opc/oxml.py:184–189  ·  view source on GitHub ↗

Add a child `` `` element with attributes set according to parameter values.

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

Source from the content-addressed store, hash-verified

182 """``<Relationships>`` element, the root element in a .rels file."""
183
184 def add_rel(self, rId: str, reltype: str, target: str, is_external: bool = False):
185 """Add a child ``<Relationship>`` element with attributes set according to
186 parameter values."""
187 target_mode = RTM.EXTERNAL if is_external else RTM.INTERNAL
188 relationship = CT_Relationship.new(rId, reltype, target, target_mode)
189 self.append(relationship)
190
191 @staticmethod
192 def new() -> CT_Relationships:

Callers 4

xmlMethod · 0.80
buildMethod · 0.80

Calls 2

appendMethod · 0.80
newMethod · 0.45