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

Method load_rel

src/docx/opc/package.py:89–97  ·  view source on GitHub ↗

Return newly added |_Relationship| instance of `reltype` between this part and `target` with key `rId`. Target mode is set to ``RTM.EXTERNAL`` if `is_external` is |True|. Intended for use during load from a serialized package, where the rId is well known. Other metho

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

Source from the content-addressed store, hash-verified

87 yield part
88
89 def load_rel(self, reltype: str, target: Part | str, rId: str, is_external: bool = False):
90 """Return newly added |_Relationship| instance of `reltype` between this part
91 and `target` with key `rId`.
92
93 Target mode is set to ``RTM.EXTERNAL`` if `is_external` is |True|. Intended for
94 use during load from a serialized package, where the rId is well known. Other
95 methods exist for adding a new relationship to the package during processing.
96 """
97 return self.rels.add_relationship(reltype, target, rId, is_external)
98
99 @property
100 def main_document_part(self):

Calls 1

add_relationshipMethod · 0.80

Tested by 1