From 018391f733ff492c0251c3fff9150530f60ffb9c Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Sat, 24 May 2014 19:15:45 +0530 Subject: [PATCH] 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 --- brewman/renderers.py | 10 +++++++++- setup.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/brewman/renderers.py b/brewman/renderers.py index eeac6883..bb1537aa 100644 --- a/brewman/renderers.py +++ b/brewman/renderers.py @@ -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) diff --git a/setup.py b/setup.py index af8c919b..d5f70709 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ requires = [ ] setup(name='brewman', - version='3.2', + version='3.3', description='brewman', long_description=README + '\n\n' + CHANGES, classifiers=[