diff --git a/jsonmapper/__init__.py b/jsonmapper/__init__.py index 3a1d88c..20e5262 100644 --- a/jsonmapper/__init__.py +++ b/jsonmapper/__init__.py @@ -251,8 +251,8 @@ class DateTimeField(Field): def _to_python(self, value): if isinstance(value, basestring): try: - value = value.split('.', 1)[0] # strip out microseconds - value = value.rstrip('Z') # remove timezone separator + value = value.split('.', 1)[0] # strip out microseconds + value = value.rstrip('Z') # remove timezone separator value = datetime(*strptime(value, '%Y-%m-%dT%H:%M:%S')[:6]) except ValueError: raise ValueError('Invalid ISO date/time %r' % value) @@ -281,7 +281,7 @@ class TimeField(Field): def _to_python(self, value): if isinstance(value, basestring): try: - value = value.split('.', 1)[0] # strip out microseconds + value = value.split('.', 1)[0] # strip out microseconds value = time(*strptime(value, '%H:%M:%S')[3:6]) except ValueError: raise ValueError('Invalid ISO time %r' % value) @@ -386,7 +386,7 @@ def _to_json(self, value): break else: # FIXME better error message - raise ValueError('Unknown value type') + raise ValueError('Unknown value type') else: value_type = value[self.type_key] mapping = self.mappings[value_type] @@ -442,7 +442,6 @@ def _to_python(self, value): def _to_json(self, value): return [self.field._to_json(item) for item in value] - class Proxy(list): def __init__(self, list, field): diff --git a/setup.py b/setup.py index 37890d2..0420f64 100755 --- a/setup.py +++ b/setup.py @@ -11,13 +11,13 @@ setup( - name = 'JSONMapper', - version = '0.1', - description = 'Python JSON mapper', - long_description = '', - author = 'Matt Good', - author_email = 'matt@matt-good.net', - license = 'BSD', - url = '', - packages = ['jsonmapper'], + name='JSONMapper', + version='0.1', + description='Python JSON mapper', + long_description='', + author='Matt Good', + author_email='matt@matt-good.net', + license='BSD', + url='', + packages=['jsonmapper'], )