Skip to content

Commit 54d00e5

Browse files
committed
docs: fix create update delete nodes guide
1 parent 1a65b90 commit 54d00e5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/docs/python-sdk/guides/create_update_delete.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ nodes:
6767
6868
A node can be created using the `create` method. The `create` method will first construct a `InfrahubNode` object in memory. This `InfrahubNode` object will then need to be saved into Infrahub using the `save` method.
6969

70-
The attributes and relationships of the `InfrahubNode` you want to create can be passed as arguments to the `create` method, or you can pass then using a dictionary.
70+
The attributes and relationships of the `InfrahubNode` you want to create can be passed as arguments to the `create` method, or you can pass them using a dictionary.
7171

7272
<Tabs groupId="async-sync">
7373
<TabItem value="Async" default>
@@ -138,7 +138,7 @@ The attributes and relationships of the `InfrahubNode` you want to create can be
138138
<TabItem value="Async" default>
139139

140140
```python
141-
interfaces = await client.get(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"])
141+
interfaces = await client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"])
142142
device = await client.create(kind="TestDevice", name="atl1-edge1", interfaces=interfaces)
143143
await device.save()
144144
```
@@ -147,7 +147,7 @@ The attributes and relationships of the `InfrahubNode` you want to create can be
147147
<TabItem value="Sync" default>
148148

149149
```python
150-
interfaces = client.get(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"])
150+
interfaces = client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"])
151151
device = client.create(kind="TestDevice", name="atl1-edge1", interfaces=interfaces)
152152
device.save()
153153
```
@@ -222,7 +222,7 @@ Adding a single relation:
222222
<TabItem value="Sync" default>
223223

224224
```python
225-
interface = client.get(kind="TestInterface", name__values="Ethernet1")
225+
interface = client.get(kind="TestInterface", name__value="Ethernet1")
226226
device = client.get(kind="TestDevice", name__value="atl1-edge1")
227227
device.interfaces.add(interface)
228228
device.save()
@@ -236,7 +236,7 @@ Adding multiple relations:
236236
<TabItem value="Async" default>
237237

238238
```python
239-
interfaces = await client.filters(kind="TestInterface", name__value=["Ethernet1", "Ethernet2"])
239+
interfaces = await client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"])
240240
device = await client.get(kind="TestDevice", name__value="atl1-edge1")
241241
device.interfaces.extend(interfaces)
242242
await device.save()
@@ -246,7 +246,7 @@ Adding multiple relations:
246246
<TabItem value="Sync" default>
247247

248248
```python
249-
interfaces = client.filters(kind="TestInterface", name__value=["Ethernet1", "Ethernet2"])
249+
interfaces = client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"])
250250
device = client.get(kind="TestDevice", name__value="atl1-edge1")
251251
device.interfaces.extend(interfaces)
252252
device.save()

0 commit comments

Comments
 (0)