Return relationship of `reltype` to `target_part`, newly added if not already present in collection.
(self, reltype: str, target_part: Part)
| 29 | return rel |
| 30 | |
| 31 | def get_or_add(self, reltype: str, target_part: Part) -> _Relationship: |
| 32 | """Return relationship of `reltype` to `target_part`, newly added if not already |
| 33 | present in collection.""" |
| 34 | rel = self._get_matching(reltype, target_part) |
| 35 | if rel is None: |
| 36 | rId = self._next_rId |
| 37 | rel = self.add_relationship(reltype, target_part, rId) |
| 38 | return rel |
| 39 | |
| 40 | def get_or_add_ext_rel(self, reltype: str, target_ref: str) -> str: |
| 41 | """Return rId of external relationship of `reltype` to `target_ref`, newly added |