Skip to content

Commit 2bd062b

Browse files
authored
Merge pull request #467 from markkuleinio/fix-update-docstring
Fix docstring of Endpoint.update()
2 parents 13bdba9 + b88fd6a commit 2bd062b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

pynetbox/core/endpoint.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,25 @@ def update(self, objects):
338338
339339
Updating objects on the `devices` endpoint:
340340
341-
>>> device = netbox.dcim.devices.update([
341+
>>> devices = nb.dcim.devices.update([
342342
... {'id': 1, 'name': 'test'},
343343
... {'id': 2, 'name': 'test2'},
344344
... ])
345-
>>> True
345+
>>> devices
346+
[test2, test]
347+
>>>
346348
347349
Use bulk update by passing a list of Records:
348350
349-
>>> devices = nb.dcim.devices.all()
351+
>>> devices = list(nb.dcim.devices.filter())
352+
>>> devices
353+
[Device1, Device2, Device3]
350354
>>> for d in devices:
351-
>>> d.name = d.name+'-test'
355+
... d.name = d.name+'-test'
356+
...
352357
>>> nb.dcim.devices.update(devices)
353-
>>> True
358+
[Device1-test, Device2-test, Device3-test]
359+
>>>
354360
"""
355361
series = []
356362
if not isinstance(objects, list):

0 commit comments

Comments
 (0)