本文整理汇总了Python中sharepoint.xml.SP.listItemID方法的典型用法代码示例。如果您正苦于以下问题:Python SP.listItemID方法的具体用法?Python SP.listItemID怎么用?Python SP.listItemID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sharepoint.xml.SP
的用法示例。
在下文中一共展示了SP.listItemID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __iter__
# 需要导入模块: from sharepoint.xml import SP [as 别名]
# 或者: from sharepoint.xml.SP import listItemID [as 别名]
def __iter__(self):
"""
Returns an iterator over attachments for a list item.
Implements http://msdn.microsoft.com/en-us/library/websvclists.lists.getattachmentcollection.aspx
"""
xml = SP.GetAttachmentCollection(SP.listName(self.list_id),
SP.listItemID(str(self.row_id)))
response = self.opener.post_soap(LIST_WEBSERVICE, xml,
soapaction='http://schemas.microsoft.com/sharepoint/soap/GetAttachmentCollection')
for url in response.xpath('//sp:Attachment', namespaces=namespaces):
yield SharePointAttachment(self, url.text)
示例2: add
# 需要导入模块: from sharepoint.xml import SP [as 别名]
# 或者: from sharepoint.xml.SP import listItemID [as 别名]
def add(self, filename, content):
xml = SP.AddAttachment(SP.listName(self.list_id), SP.listItemID(str(self.row_id)), SP.fileName(filename), SP.attachment(content))
response = self.opener.post_soap(LIST_WEBSERVICE, xml,
soapaction='http://schemas.microsoft.com/sharepoint/soap/AddAttachment')
示例3: delete
# 需要导入模块: from sharepoint.xml import SP [as 别名]
# 或者: from sharepoint.xml.SP import listItemID [as 别名]
def delete(self, url):
xml = SP.DeleteAttachment(SP.listName(self.list_id), SP.listItemID(str(self.row_id)), SP.url(url))
response = self.opener.post_soap(LIST_WEBSERVICE, xml,
soapaction='http://schemas.microsoft.com/sharepoint/soap/DeleteAttachment')