mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
"added askForObjectFields()"
This commit is contained in:
parent
922a414c95
commit
c7a09a3926
@ -91,9 +91,29 @@ class AsyncRequest(DirectObject):
|
|||||||
self.acceptOnce(
|
self.acceptOnce(
|
||||||
"doFieldResponse-%s"%(context,),
|
"doFieldResponse-%s"%(context,),
|
||||||
self._checkCompletion, [key])
|
self._checkCompletion, [key])
|
||||||
|
|
||||||
self.air.queryObjectField(dclassName, fieldName, doId, context)
|
self.air.queryObjectField(dclassName, fieldName, doId, context)
|
||||||
self._resetTimeoutTask()
|
self._resetTimeoutTask()
|
||||||
|
|
||||||
|
def askForObjectFields(
|
||||||
|
self, dclassName, fieldNames, doId, key = None, context = None):
|
||||||
|
"""
|
||||||
|
Request an already created object, i.e. read from database.
|
||||||
|
"""
|
||||||
|
assert AsyncRequest.notify.debugCall()
|
||||||
|
if key is None:
|
||||||
|
# default the dictionary key to the fieldName
|
||||||
|
key = fieldNames[0]
|
||||||
|
assert doId
|
||||||
|
if context is None:
|
||||||
|
context = self.air.allocateContext()
|
||||||
|
self.air.contextToClassName[context] = dclassName
|
||||||
|
self.acceptOnce(
|
||||||
|
"doFieldResponse-%s"%(context,),
|
||||||
|
self._checkCompletion, [key])
|
||||||
|
self.air.queryObjectFields(dclassName, fieldNames, doId, context)
|
||||||
|
self._resetTimeoutTask()
|
||||||
|
|
||||||
def askForObject(self, doId, context = None):
|
def askForObject(self, doId, context = None):
|
||||||
"""
|
"""
|
||||||
Request an already created object, i.e. read from database.
|
Request an already created object, i.e. read from database.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user