Skip to content

Commit

Permalink
Update python code example to more idiomatic way of updating an item
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTitu committed Aug 27, 2024
1 parent 871fc7f commit ec92b54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ async def main():

print(dict(item))

# Update a field in your item
item.fields[0].value = "new_value"
# Update a field in your item (change the password)
updated_item = Item(**dict(item))
next(f for f in updated_item.fields if f.title == "password").value = "new_pass"
updated_item = await client.items.put(updated_item)
updated_item = await client.items.put(item)

print(dict(updated_item))
Expand Down

0 comments on commit ec92b54

Please sign in to comment.