'Attempt to encode decimal by converting it to float'

@staticmethod
def encode_as_decimal(obj):

    if isinstance(obj, decimal.Decimal):
        return float(obj)
    else:
        raise NotEncodable
