From e5fb8ad7e8de186e3dccf1d16d51fc99dfc4ceab Mon Sep 17 00:00:00 2001 From: Waldecir Santos Date: Sun, 17 Aug 2014 00:48:22 -0300 Subject: [PATCH] For now we should use FloatType instead. --- motorm/__init__.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/motorm/__init__.py b/motorm/__init__.py index d8f98a1..8774e78 100644 --- a/motorm/__init__.py +++ b/motorm/__init__.py @@ -1,8 +1,6 @@ #!/bin/env python from schematics.models import Model, ModelMeta from schematics.contrib.mongo import ObjectIdType -from pymongo.son_manipulator import SONManipulator -from decimal import Decimal #-- Tornado from tornado.concurrent import return_future @@ -19,25 +17,6 @@ _mc = None BATCH = 5 -#FROM: https://gist.github.com/reedobrien/745735 -class DecimalTransform(SONManipulator): - def transform_incoming(self, son, collection): - for (key, value) in son.items(): - if isinstance(value, Decimal): - son[key] = {'_type' : 'decimal', 'value' : unicode(value)} - elif isinstance(value, dict): - son[key] = self.transform_incoming(value, collection) - return son - - def transform_outgoing(self, son, collection): - for (key, value) in son.items(): - if isinstance(value, dict): - if "_type" in value and value["_type"] == "decimal": - son[key] = Decimal(value['value']) - else: - son[key] = self.transform_outgoing(value, collection) - return son - def connect(db, io_loop=None): global _db global _mc