|

楼主 |
发表于 2018-12-1 15:10:20
|
显示全部楼层
嗯,已经知道怎么做了,方法是:
# key 实体的名字
# value 这种实体类型自动加载的次数
autoLoadEntities = {}
def onBaseAppReady(isBootstrap):
if isBootstrap == False :
return
if autoLoadEntities.get("MailEntity") == None :
KBEngine.createEntityLocally("MailEntity")
def onAutoLoadEntityCreate( entityType, dbID ):
KBEngine.createEntityFromDBID(entityType, dbID)
hasCnt = autoLoadEntities.get(entityType, 0)
autoLoadEntities[entityType] = hasCnt + 1
大家以后有更好的方法,记得说一下啊 |
|