Changes between Version 6 and Version 7 of Simplistic_json_rpc-dispatcher
- Timestamp:
- Nov 24, 2009, 4:59:52 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Simplistic_json_rpc-dispatcher
v6 v7 9 9 jsonrpc_methods = [] 10 10 11 def JSON_RPC_ io(obj):11 def JSON_RPC_dispatcher(obj): 12 12 rpc_inputs = json.loads(obj.raw_post_data) 13 13 sub_eval = str(rpc_inputs['method']) + '(rpc_inputs[\'params\'])' … … 29 29 This function works as a decoding/encoding dispatcher between Django's '''HttpRequest'''-object and 30 30 arbitrary defined method-functions of the json-rpc service. Those '''method-functions shall return''' a 31 dictionary-object as '''{'result': <result_data>, 'error': <error_data>}''' and their '''names shall be appended/registered''' to the '''jsonrpc_methods list'''. This dispatcher-function is generally suitable for json-rpc apps handling different data process/validate tasks.31 dictionary-object as '''{'result': <result_data>, 'error': <error_data>}''' and their '''names shall be appended/registered''' to the '''jsonrpc_methods list'''. This dispatcher-function is generally suitable for any json-rpc app and neutral to the exact version of the json-rpc protocol in consideration.