Skip to content

Commit

Permalink
Added some other examples using contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
muflone committed Jun 5, 2021
1 parent e285ea5 commit d83f77d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions samples/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,21 @@
# Delete a record
api.delete(entity_id=results)
print('delete')

# Find customers from France with different languages
filters.append(Filter(field='lang',
compare_type=CompareType.NOT_EQUAL,
value='fr_FR'))
filters.append(Filter(field='country_id',
compare_type=CompareType.EQUAL,
value='France'))
results = api.search(filters=filters)
print('search', len(results), results)

# Update those customers to French language
for entity_id in results:
api.update(entity_id=entity_id,
values={'lang': 'fr_FR'})
print('updating ID', entity_id)
results = api.search(filters=filters)
print('search', len(results), results)

0 comments on commit d83f77d

Please sign in to comment.