Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
c7a45b04
Commit
c7a45b04
authored
Dec 08, 2016
by
LE GAC Renaud
Browse files
Update directsvc.JSONEncoder to add a constructor.
parent
30d0e4d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
modules/plugin_dbui/directsvc.py
modules/plugin_dbui/directsvc.py
+32
-0
No files found.
modules/plugin_dbui/directsvc.py
View file @
c7a45b04
...
...
@@ -26,6 +26,38 @@ class JSONEncoder(json.JSONEncoder):
- time
"""
def
__init__
(
self
,
skipkeys
=
False
,
ensure_ascii
=
True
,
check_circular
=
True
,
allow_nan
=
True
,
sort_keys
=
False
,
indent
=
None
,
separators
=
None
,
encoding
=
'utf-8'
,
default
=
None
,
use_decimal
=
False
):
"""
Note:
* Copy from the base class gluon.contrib.simplejson
* the controller plugin_dbui.dbui_conf is crashing if the
constructor is not defined (not understood)
"""
self
.
skipkeys
=
skipkeys
self
.
ensure_ascii
=
ensure_ascii
self
.
check_circular
=
check_circular
self
.
allow_nan
=
allow_nan
self
.
sort_keys
=
sort_keys
self
.
use_decimal
=
use_decimal
if
isinstance
(
indent
,
(
int
,
long
)):
indent
=
' '
*
indent
self
.
indent
=
indent
if
separators
is
not
None
:
self
.
item_separator
,
self
.
key_separator
=
separators
if
default
is
not
None
:
self
.
default
=
default
self
.
encoding
=
encoding
def
default
(
self
,
obj
):
if
isinstance
(
obj
,
(
datetime
.
date
,
...
...
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