v 2.2.1
Changelog
- Improved support for SharePoint API Batch requests
Here is the comparison of two approaches, in the first example update operation is submitted to server per every list item, while in the second one multiple list item update operations are submitted via a since (batch) request:
list_tasks = ctx.web.lists.get_by_title("Tasks")
items = list_tasks.items.get().execute_query() #
for task_id, item in enumerate(items):
task_prefix = str(randint(0, 10000))
item.set_property("Title", f"Task {task_prefix}")
item.update()
ctx.execute_query() # <- update operation is submitted to server per every list item
list_tasks = ctx.web.lists.get_by_title("Tasks")
items = list_tasks.items.get().execute_query()
for task_id, item in enumerate(items):
task_prefix = str(randint(0, 10000))
item.set_property("Title", f"Task {task_prefix}")
item.update()
ctx.execute_batch() # <- construct a single (batch) for all list items and submit to server
- API improvements for Fluent interface, for example, instead:
list = client.web.lists.get_by_title(list_title)
list.delete_object()
client.execute_query()
list delete operation could be constructed and submitted to a server in a more compact manner:
client.web.lists.get_by_title(list_title).delete_object().execute_query()
-
SharePoint API
Changes
namespace improvements (#259), here is the list of operations:Site.get_changes
Web.get_changes
List.get_changes
ListItem.get_changes
-
SharePoint API
RecycleBin
entity class and operations