Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
2  Changelog
... ... @@ -1,4 +1,4 @@
1   -2012-10-03 klen 1.9.8
  1 +2012-10-03 klen 1.9.9
2 2
3 3 * Fix access logging
4 4
2  adrest/__init__.py
... ... @@ -1,4 +1,4 @@
1   -version_info = (1, 9, 8)
  1 +version_info = (1, 9, 9)
2 2
3 3 __version__ = version = '.'.join(map(str, version_info))
4 4 __project__ = PROJECT = __name__
6 adrest/utils/serializer.py
... ... @@ -1,6 +1,5 @@
1 1 import abc
2 2 import collections
3   -import numbers
4 3 from datetime import datetime, date, time
5 4 from decimal import Decimal
6 5
@@ -41,9 +40,6 @@ def to_simple(self, value, **options):
41 40 if isinstance(value, Decimal):
42 41 return float(str(value))
43 42
44   - if isinstance(value, numbers.Number):
45   - return value
46   -
47 43 if isinstance(value, (datetime, date, time)):
48 44 return self.to_simple_datetime(value)
49 45
@@ -65,7 +61,7 @@ def to_simple(self, value, **options):
65 61 if isinstance(value, Model):
66 62 return self.to_simple_model(value, **options)
67 63
68   - return smart_unicode(value)
  64 + return value
69 65
70 66 @staticmethod
71 67 def to_simple_datetime(value):
4 tests/main/tests.py
@@ -37,8 +37,8 @@ def get(self, request):
37 37 response = test.dispatch(request)
38 38 self.assertContains(response, 'test')
39 39
40   - content = emitter.JSONSerializer().serialize([1, Decimal('3.4')])
41   - self.assertEqual(content, '[1, 3.4]')
  40 + content = emitter.JSONSerializer().serialize([1, Decimal('3.4'), None])
  41 + self.assertTrue('3.' in content and 'null' in content)
42 42
43 43
44 44 class MetaTest(TestCase):

No commit comments for this range

Something went wrong with that request. Please try again.