Skip to content

Commit

Permalink
Create, update and delete the same record
Browse files Browse the repository at this point in the history
  • Loading branch information
muflone committed Jun 6, 2021
1 parent 9148706 commit b4c5ef3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions samples/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@
fields=('id', 'name'))
print('get', results)

# Create a new record
entity_id = model.create(values={'firstname': 'TEST TEST TEST',
'lastname': '123 456'})
print('create', entity_id)

# Update a record by ID
model.update(entity_id=24551,
values={'pinned_notes': 'TEST TEST TEST'})
results = model.get(entity_id=24551,
fields=('id', 'pinned_notes'))
model.update(entity_id=entity_id,
values={'street': 'TEST TEST TEST'})
results = model.get(entity_id=entity_id,
fields=('id', 'street'))
print('update', results)

# Create a new record
results = model.create(values={'firstname': 'TEST TEST TEST',
'lastname': '123 456'})
print('create', results)

# Delete a record
model.delete(entity_id=results)
model.delete(entity_id=entity_id)
print('delete')

# Find customers from France with different languages
Expand Down

0 comments on commit b4c5ef3

Please sign in to comment.