Commit 36805cfc by aagusti

syart pelayanan api

1 parent f39fa143
...@@ -302,9 +302,10 @@ def validate_time(request): ...@@ -302,9 +302,10 @@ def validate_time(request):
return time_stamp return time_stamp
def get_jsonrpc(method, params): def get_jsonrpc(method, params, **kwargs):
rid= kwargs.get("id") or int(get_random_number(6))
return dict(jsonrpc='2.0', method=method, params=params, return dict(jsonrpc='2.0', method=method, params=params,
id=int(get_random_number(6))) id=rid)
def send_rpc(auth, message): def send_rpc(auth, message):
""" """
......
...@@ -50,6 +50,7 @@ def form2dict(obj): ...@@ -50,6 +50,7 @@ def form2dict(obj):
elif v and hasattr(v, "__dict__") and \ elif v and hasattr(v, "__dict__") and \
getattr(v, "__dict__", str(v)): getattr(v, "__dict__", str(v)):
log.debug(v)
d[k] = form2dict(v) d[k] = form2dict(v)
elif isinstance(v, list): elif isinstance(v, list):
lv = [] lv = []
...@@ -108,6 +109,7 @@ def formfield2dict(obj): ...@@ -108,6 +109,7 @@ def formfield2dict(obj):
buttons=resp["buttons"], buttons=resp["buttons"],
url=resp.get("url"), url=resp.get("url"),
table=table, table=table,
method = resp.get("method")
) )
log.debug(result) log.debug(result)
return result return result
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!