@@ -1792,7 +1792,7 @@ def manage_object_template_relationships(self) -> None:
17921792 "name" : "object_template" ,
17931793 "identifier" : "node__objecttemplate" ,
17941794 "peer" : self ._get_object_template_kind (node .kind ),
1795- "kind" : RelationshipKind .ATTRIBUTE ,
1795+ "kind" : RelationshipKind .TEMPLATE ,
17961796 "cardinality" : RelationshipCardinality .ONE ,
17971797 "branch" : BranchSupportType .AWARE ,
17981798 "order_weight" : 1 ,
@@ -1829,16 +1829,24 @@ def add_relationships_to_template(self, node: NodeSchema) -> None:
18291829 if relationship .peer in [
18301830 InfrahubKind .GENERICGROUP ,
18311831 InfrahubKind .PROFILE ,
1832- ] or relationship .kind not in [RelationshipKind .COMPONENT , RelationshipKind .PARENT ]:
1832+ ] or relationship .kind not in [
1833+ RelationshipKind .COMPONENT ,
1834+ RelationshipKind .PARENT ,
1835+ RelationshipKind .ATTRIBUTE ,
1836+ ]:
18331837 continue
18341838
1835- rel_template_peer = self ._get_object_template_kind (node_kind = relationship .peer )
1839+ rel_template_peer = (
1840+ self ._get_object_template_kind (node_kind = relationship .peer )
1841+ if relationship .kind != RelationshipKind .ATTRIBUTE
1842+ else relationship .peer
1843+ )
18361844 template_schema .relationships .append (
18371845 RelationshipSchema (
18381846 name = relationship .name ,
18391847 peer = rel_template_peer ,
18401848 kind = relationship .kind ,
1841- optional = relationship .kind == RelationshipKind .COMPONENT ,
1849+ optional = relationship .kind in [ RelationshipKind .COMPONENT , RelationshipKind . ATTRIBUTE ] ,
18421850 cardinality = relationship .cardinality ,
18431851 branch = relationship .branch ,
18441852 identifier = self ._generate_identifier_string (template_schema .kind , rel_template_peer ),
0 commit comments