Skip to content

Commit

Permalink
Make views example less confusing (#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
erlendvollset authored Oct 18, 2024
1 parent f37aa94 commit 8ca9b23
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cognite/client/_api/data_modeling/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
... ),
... }
... )
Expand All @@ -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",
... ),
... }
... )
Expand Down

0 comments on commit 8ca9b23

Please sign in to comment.