diff --git a/cognite/client/_api/data_modeling/views.py b/cognite/client/_api/data_modeling/views.py index 76f537bc1..58ee367d7 100644 --- a/cognite/client/_api/data_modeling/views.py +++ b/cognite/client/_api/data_modeling/views.py @@ -263,6 +263,7 @@ def apply(self, view: ViewApply | Sequence[ViewApply]) -> View | ViewList: ... ViewId ... ) >>> client = CogniteClient() + >>> acts_in_edge_type = DirectRelationReference(space="imdb", external_id="acts-in") >>> movie_view = ViewApply( ... space="imdb", ... external_id="Movie", @@ -274,12 +275,10 @@ def apply(self, view: ViewApply | Sequence[ViewApply]) -> View | ViewList: ... container_property_identifier="title", ... ), ... "actors": MultiEdgeConnectionApply( - ... type=DirectRelationReference( - ... space="imdb", external_id="Movie.actors" - ... ), + ... type=acts_in_edge_type, + ... direction="inwards", ... source=ViewId("imdb", "Actor", "1"), ... name="actors", - ... direction="outwards", ... ), ... } ... ) @@ -295,12 +294,10 @@ def apply(self, view: ViewApply | Sequence[ViewApply]) -> View | ViewList: ... container_property_identifier="name", ... ), ... "movies": MultiEdgeConnectionApply( - ... type=DirectRelationReference( - ... space="imdb", external_id="Role.movies" - ... ), + ... type=acts_in_edge_type, + ... direction="outwards", ... source=ViewId("imdb", "Movie", "1"), ... name="movies", - ... direction="outwards", ... ), ... } ... )