mirror of https://github.com/krateng/maloja.git
Now actually patching the JSON encoder bottle uses
This commit is contained in:
parent
490f6f9f99
commit
7aa7f8f746
|
@ -1,6 +1,13 @@
|
|||
# custom json encoding
|
||||
|
||||
from simplejson import JSONEncoder
|
||||
# make sure we use the json encoder that bottle uses
|
||||
try:
|
||||
from simplejson import JSONEncoder
|
||||
except ImportError:
|
||||
try:
|
||||
from json import JSONEncoder
|
||||
except ImportError:
|
||||
from django.utils.simplejson import JSONEncoder
|
||||
|
||||
def newdefault(self,object):
|
||||
return getattr(object.__class__,"__json__", olddefault)(object)
|
||||
|
|
Loading…
Reference in New Issue