RPC¶
- class trytond.rpc.RPC([readonly[, instantiate[[, decorator, result[, check_access[, unique[, fresh_session[, cache[, timeout[, size_limits]]]]]]]]]])¶
Define the behavior of Remote Procedure Call.
Instance attributes are:
- RPC.readonly¶
The transaction mode
- RPC.instantiate¶
The position or the slice of the argument to be instanciated
- RPC.decorator¶
The function to decorate the called procedure with
- RPC.result¶
The function to transform the result
- RPC.check_access¶
Set
_check_accessin the context to activate the access right on model and field. Default isTrue.
- RPC.unique¶
If set, it ensures the instantiated records are unique. Default is
True.
- RPC.fresh_session¶
If set, it requires a fresh session. Default is
False.
- RPC.timeout¶
The timeout in second for the call.
0orNonemeans no timeout is applied. Default isNone.
- RPC.size_limits¶
A dictionary with size limits for the arguments. The key of the dictionary define the position of the argument when it is an integer, or a slice of arguments when it is a tuple.
RPCCache¶
- class trytond.rpc.RPCCache([days[, seconds])¶
Define cache duration of RPC result.
Instance attributes are:
- RPC.duration¶
A
datetime.timedeltainstance.
Instance methods are:
- RCP.headers()¶
Return a dictionary of the headers.
Exceptions¶
- exception trytond.rpc.RPCReturnException¶
The base class of exceptions to return the result of
resultmethod instead of raising an exception.The
Transactionis rollbacked and tasks are cleared.