本文整理匯總了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