Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
common_helper_encoder
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
common_helper_encoder
Commits
3c7a1309
Commit
3c7a1309
authored
Apr 29, 2016
by
Peter Weidenbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP8!
parent
97a969ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
json_encoder.py
common_helper_encoder/json_encoder.py
+2
-1
No files found.
common_helper_encoder/json_encoder.py
View file @
3c7a1309
import
json
import
json
import
datetime
import
datetime
class
ReportEncoder
(
json
.
JSONEncoder
):
class
ReportEncoder
(
json
.
JSONEncoder
):
def
default
(
self
,
obj
):
def
default
(
self
,
obj
):
if
isinstance
(
obj
,
datetime
.
datetime
):
if
isinstance
(
obj
,
datetime
.
datetime
):
return
obj
.
isoformat
()
return
obj
.
isoformat
()
return
json
.
JSONEncoder
.
default
(
self
,
obj
)
return
json
.
JSONEncoder
.
default
(
self
,
obj
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment