Skip to content

Commit

Permalink
Fix README about patch changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed May 7, 2018
1 parent 3f37003 commit f288d38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.rst
Expand Up @@ -150,10 +150,10 @@ If no specific bucket name is provided, the "default" bucket is used.
# Or modify some fields in an existing bucket.
# The Kinto server supports different types of patches, which can be used from kinto_http.patch_type.
client.patch_bucket(id='payments', data=BasicPatch({'status': 'updated'}))
client.patch_bucket(id='payments', changes=BasicPatch({'status': 'updated'}))
# It is also possible to manipulate bucket permissions (see later)
client.patch_bucket(id='payments', data=BasicPatch(permissions={}))
client.patch_bucket(id='payments', changes=BasicPatch(permissions={}))
# Or delete a bucket and everything under.
client.delete_bucket(id='payment')
Expand Down Expand Up @@ -184,7 +184,7 @@ A group associates a name to a list of principals. It is useful in order to hand
# Or modify some fields in an existing group.
# This uses the server's support for JSON patch, but any patch_type is accepted.
client.patch_group(id='receipts', bucket='payments',
data=JSONPatch([{'op': 'add', 'location': 'description', 'value': 'my group'}]))
changes=JSONPatch([{'op': 'add', 'path': '/data/members/0', 'value': 'ldap:user@corp.com'}]))
# To delete an existing group.
client.delete_group(id='receipts', bucket='payments')
Expand Down Expand Up @@ -213,7 +213,7 @@ A collection is where records are stored.
client.update_collection(id='receipts', bucket='payments', data={'description':'bleeh'})
# Or modify some fields of an existing collection.
client.patch_collection(id='receipts', bucket='payments', data=MergePatch({'status':'updated'}))
client.patch_collection(id='receipts', bucket='payments', changes=MergePatch({'status':'updated'}))
# To delete an existing collection.
client.delete_collection(id='receipts', bucket='payments')
Expand Down Expand Up @@ -255,7 +255,7 @@ A record is a dict with the "permissions" and "data" keys.
client.update_record(data={'status': 'unknown'}, id='todo2', collection='todos', bucket='default')
# Or modify some fields in an existing record.
client.patch_record(data=MergePatch({'assignee': 'bob'}), id='todo2', collection='todos', bucket='default')
client.patch_record(changes=MergePatch({'assignee': 'bob'}), id='todo2', collection='todos', bucket='default')
# To delete an existing record.
client.delete_record(id='89881454-e4e9-4ef0-99a9-404d95900352',
Expand Down

0 comments on commit f288d38

Please sign in to comment.