本文整理汇总了Python中annalist.models.entitydata.EntityData.load方法的典型用法代码示例。如果您正苦于以下问题:Python EntityData.load方法的具体用法?Python EntityData.load怎么用?Python EntityData.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类annalist.models.entitydata.EntityData
的用法示例。
在下文中一共展示了EntityData.load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_entitydata_create_load
# 需要导入模块: from annalist.models.entitydata import EntityData [as 别名]
# 或者: from annalist.models.entitydata.EntityData import load [as 别名]
def test_entitydata_create_load(self):
e = EntityData.create(self.testdata, "entitydata1", entitydata_create_values("entitydata1"))
self.assertEqual(e._entitydir, entitydata_dir(entity_id="entitydata1"))
self.assertTrue(os.path.exists(e._entitydir))
ed = EntityData.load(self.testdata, "entitydata1").get_values()
v = entitydata_values("entitydata1")
self.assertKeysMatch(ed, v)
self.assertDictionaryMatch(ed, v)
return
示例2: entities
# 需要导入模块: from annalist.models.entitydata import EntityData [as 别名]
# 或者: from annalist.models.entitydata.EntityData import load [as 别名]
def entities(self):
"""
Generator enumerates and returns records of given type
"""
for f in self._children(EntityData):
log.debug("RecordTypeData.entities: f %s"%f)
e = EntityData.load(self, f)
if e:
yield e
return
示例3: _check_entity_data_values
# 需要导入模块: from annalist.models.entitydata import EntityData [as 别名]
# 或者: from annalist.models.entitydata.EntityData import load [as 别名]
def _check_entity_data_values(self,
entity_id, type_id="testtype", type_uri=None,
update="Entity", parent=None,
update_dict=None):
"Helper function checks content of form-updated record type entry with supplied entity_id"
recorddata = RecordTypeData.load(self.testcoll, type_id)
self.assertTrue(EntityData.exists(recorddata, entity_id))
e = EntityData.load(recorddata, entity_id)
self.assertEqual(e.get_id(), entity_id)
self.assertEqual(e.get_url(""), TestHostUri + entity_url("testcoll", type_id, entity_id))
v = entitydata_values(entity_id, type_id=type_id, type_uri=type_uri, update=update)
if update_dict:
v.update(update_dict)
for k in update_dict:
if update_dict[k] is None:
v.pop(k, None)
self.assertDictionaryMatch(e.get_values(), v)
return e