Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f39fa143
authored
Aug 05, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
penambahan fungsi default render json buat date
1 parent
09525b7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
opensipkd/tools/api.py
opensipkd/tools/api.py
View file @
f39fa14
...
...
@@ -3,7 +3,7 @@ import hashlib
import
hmac
import
json
import
sys
from
datetime
import
datetime
from
datetime
import
datetime
,
date
import
requests
from
pyramid_rpc.jsonrpc
import
JsonRpcError
...
...
@@ -346,3 +346,9 @@ def send_rpc(auth, message):
##############################
lima_menit
=
300
def
json_serial
(
obj
):
"""JSON serializer for objects not serializable by default json code"""
if
isinstance
(
obj
,
(
datetime
,
date
)):
return
obj
.
isoformat
()
raise
TypeError
(
"Type
%
s not serializable"
%
type
(
obj
))
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment