` ` element. Represents a single relationship from a source to a target part.
| 90 | |
| 91 | |
| 92 | class CT_Relationship(BaseOxmlElement): |
| 93 | """`<Relationship>` element. |
| 94 | |
| 95 | Represents a single relationship from a source to a target part. |
| 96 | """ |
| 97 | |
| 98 | rId: str = RequiredAttribute("Id", XsdId) # pyright: ignore[reportAssignmentType] |
| 99 | reltype: str = RequiredAttribute("Type", XsdAnyUri) # pyright: ignore[reportAssignmentType] |
| 100 | target_ref: str = RequiredAttribute( # pyright: ignore[reportAssignmentType] |
| 101 | "Target", XsdAnyUri |
| 102 | ) |
| 103 | targetMode: str = OptionalAttribute( # pyright: ignore[reportAssignmentType] |
| 104 | "TargetMode", ST_TargetMode, default=RTM.INTERNAL |
| 105 | ) |
| 106 | |
| 107 | @classmethod |
| 108 | def new( |
| 109 | cls, rId: str, reltype: str, target_ref: str, target_mode: str = RTM.INTERNAL |
| 110 | ) -> CT_Relationship: |
| 111 | """Return a new `<Relationship>` element. |
| 112 | |
| 113 | `target_ref` is either a partname or a URI. |
| 114 | """ |
| 115 | relationship = cast(CT_Relationship, parse_xml(f'<Relationship xmlns="{nsmap["pr"]}"/>')) |
| 116 | relationship.rId = rId |
| 117 | relationship.reltype = reltype |
| 118 | relationship.target_ref = target_ref |
| 119 | relationship.targetMode = target_mode |
| 120 | return relationship |
| 121 | |
| 122 | |
| 123 | class CT_Relationships(BaseOxmlElement): |
nothing calls this directly
no test coverage detected
searching dependent graphs…