RelatedObjectMgr

Inheritance:

Methods of RelatedObjectMgr:

__generateObjectList
def __generateObjectList(self, doIdList)

Undocumented function.

__generated
def __generated(self, object)

Undocumented function.

__init__
def __init__(self, cr)

Undocumented function.

__listenFor
def __listenFor(self, doId)

Undocumented function.

__noListenFor
def __noListenFor(self, doId)

Undocumented function.

__removePending
def __removePending(self, tuple, doIdsPending)

Undocumented function.

__timeoutExpired
def __timeoutExpired(self, tuple)

Undocumented function.

abortAllRequests
def abortAllRequests(self)

Call this method to abruptly abort all pending requests, but leave the RelatedObjectMgr in a state for accepting more requests.

abortRequest
def abortRequest(self, tuple)

Aborts a previous request. The parameter is the return value from a previous call to requestObjects(). The pending request is removed from the queue and no further callbacks will be called.
See Also: requestObjects()

destroy
def destroy(self)

Undocumented function.

requestObjects
def requestObjects(self, doIdList, allCallback=None, eachCallback=None, timeout=None, timeoutCallback=None)

Requests a callback to be called when the objects in the doIdList are generated. The allCallback will be called only when all the objects have been generated (and it receives a list of objects, in the order given in doIdList). The eachCallback is called as each object is generated, and receives only the object itself.
If the objects already exist, the appropriate callback is called immediately.
If all of the objects are not generated within the indicated timeout time, the timeoutCallback is called instead, with the original doIdList as the parameter. If the timeoutCallback is None, then allCallback is called on timeout, with the list of objects that have been generated so far, and None for objects that have not been generated.
If any element of doIdList is None or 0, it is ignored, and None is passed in its place in the object list passed to the callback.
The return value may be saved and passed to a future call to abortRequest(), in order to abort a pending request before the timeout expires.
Actually, you should be careful to call abortRequest() if you have made a call to requestObjects() that has not been resolved. To find examples, do a search for abortRequest() to find out how other code is using it. A common idiom is to store the result from requestObjects() and call abortRequest() if delete() or destroy() is called on the requesting object.
See Also: abortRequest()