"added askForObjectFields()"

This commit is contained in:
Josh Wilson 2007-05-16 01:15:13 +00:00
parent 922a414c95
commit c7a09a3926

View File

@ -91,9 +91,29 @@ class AsyncRequest(DirectObject):
self.acceptOnce(
"doFieldResponse-%s"%(context,),
self._checkCompletion, [key])
self.air.queryObjectField(dclassName, fieldName, doId, context)
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):
"""
Request an already created object, i.e. read from database.