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
97a969ac
Commit
97a969ac
authored
9 years ago
by
Timm Behner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSONEncoder for Reports
parent
548866d4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
__init__.py
common_helper_encoder/__init__.py
+2
-2
json_decoder.py
common_helper_encoder/json_decoder.py
+0
-7
json_encoder.py
common_helper_encoder/json_encoder.py
+8
-0
No files found.
common_helper_encoder/__init__.py
View file @
97a969ac
from
.json_
decoder
import
Datetime
Encoder
from
.json_
encoder
import
Report
Encoder
__all__
=
[
'
Datetime
Encoder'
,
'
Report
Encoder'
,
]
This diff is collapsed.
Click to expand it.
common_helper_encoder/json_decoder.py
deleted
100644 → 0
View file @
548866d4
import
json
class
DatetimeEncoder
(
json
.
JSONEncoder
):
def
default
(
self
,
obj
):
if
isinstance
(
value
,
datetime
.
datetime
):
return
value
.
isoformat
()
return
json
.
JSONEncoder
.
default
(
self
,
obj
)
This diff is collapsed.
Click to expand it.
common_helper_encoder/json_encoder.py
0 → 100644
View file @
97a969ac
import
json
import
datetime
class
ReportEncoder
(
json
.
JSONEncoder
):
def
default
(
self
,
obj
):
if
isinstance
(
obj
,
datetime
.
datetime
):
return
obj
.
isoformat
()
return
json
.
JSONEncoder
.
default
(
self
,
obj
)
This diff is collapsed.
Click to expand it.
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