本文整理汇总了Python中mgi.models.XMLdata.update方法的典型用法代码示例。如果您正苦于以下问题:Python XMLdata.update方法的具体用法?Python XMLdata.update怎么用?Python XMLdata.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mgi.models.XMLdata
的用法示例。
在下文中一共展示了XMLdata.update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list_test_deleted
# 需要导入模块: from mgi.models import XMLdata [as 别名]
# 或者: from mgi.models.XMLdata import update [as 别名]
def list_test_deleted(self, verb):
self.dump_oai_templ_mf_xslt()
self.dump_oai_my_metadata_format()
self.dump_oai_my_set()
self.dump_xmldata()
data = {'verb': verb, 'metadataPrefix': 'oai_soft'}
r = self.doRequestServer(data=data)
self.isStatusOK(r.status_code)
#Check attribute status='deleted' of header doesn't exist
self.checkTagExist(r.text, verb)
#Delete one record
template = Template.objects(filename='Software.xsd').get()
dataSoft = XMLdata.find({'schema': str(template.id), 'status': {'$ne': Status.DELETED}})
if len(dataSoft) > 0:
XMLdata.update(dataSoft[0]['_id'], {'status': Status.DELETED})
r = self.doRequestServer(data=data)
self.isStatusOK(r.status_code)
self.checkTagExist(r.text, verb)
#Check attribute status='deleted' of header does exist
self.checkTagWithParamExist(r.text, 'header', 'status="deleted"')
示例2: test_get_record_deleted
# 需要导入模块: from mgi.models import XMLdata [as 别名]
# 或者: from mgi.models.XMLdata import update [as 别名]
def test_get_record_deleted(self):
self.dump_oai_templ_mf_xslt()
self.dump_oai_my_metadata_format()
self.dump_oai_my_set()
self.dump_xmldata()
template = Template.objects(filename='Software.xsd').get()
dataSoft = XMLdata.find({'schema': str(template.id), 'status': {'$ne': Status.DELETED}})
if len(dataSoft) > 0:
xmlDataId = dataSoft[0]['_id']
identifier = '%s:%s:id/%s' % (OAI_SCHEME, OAI_REPO_IDENTIFIER, xmlDataId)
data = {'verb': 'GetRecord', 'identifier': identifier, 'metadataPrefix': 'oai_soft'}
r = self.doRequestServer(data=data)
self.isStatusOK(r.status_code)
#Check attribute status='deleted' of header doesn't exist
self.checkTagExist(r.text, 'GetRecord')
self.checkTagExist(r.text, 'record')
#Delete one record
XMLdata.update(xmlDataId, {'status': Status.DELETED})
r = self.doRequestServer(data=data)
self.isStatusOK(r.status_code)
#Check attribute status='deleted' of header does exist
self.checkTagExist(r.text, 'GetRecord')
# Only for NMRR
self.checkTagWithParamExist(r.text, 'header', 'status="deleted"')