Fix: For some reason, the last commit is not updating the webapp on webfaction. This is to try and fix it.
Chore: Bumped the version to 3.3
This commit is contained in:
parent
29653b524a
commit
018391f733
@ -2,8 +2,10 @@ import csv
|
||||
from decimal import Decimal
|
||||
from io import StringIO
|
||||
import uuid
|
||||
|
||||
from pyramid.renderers import JSON
|
||||
|
||||
|
||||
__author__ = 'tanshu'
|
||||
|
||||
|
||||
@ -35,16 +37,22 @@ class CSVRenderer(object):
|
||||
|
||||
json_renderer = JSON()
|
||||
|
||||
|
||||
class DecimalAsFloatHack(float):
|
||||
def __init__(self, d):
|
||||
self.d = d
|
||||
|
||||
def __repr__(self):
|
||||
# return format(self.d, '.5f')
|
||||
return str(self.d)
|
||||
|
||||
|
||||
def decimal_adaptor(obj, request):
|
||||
return DecimalAsFloatHack(obj)
|
||||
|
||||
|
||||
def uuid_adaptor(obj, request):
|
||||
return str(obj)
|
||||
|
||||
|
||||
json_renderer.add_adapter(Decimal, decimal_adaptor)
|
||||
json_renderer.add_adapter(uuid.UUID, uuid_adaptor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user