def generate_contacts(context):
contacts_list = ctx.web.lists.get_by_title("Contacts")
fake = Faker()
for idx in range(0, 1):
name = fake.name()
contact_properties = {'__metadata': {'type': 'SP.Data.ContactsListItem'}, 'Title': name}
contact_item = contacts_list.add_item(contact_properties)
context.execute_query()
print("Contact '{0}' has been created".format(contact_item.properties["Title"]))
data_generator.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录