Add support for Python 2.6

Issue #32 new
Greg Hunt
created an issue

I've just started a prototype in Python 2.6 using dynamodb-mapper. In model.py, there are two lines which initialize a dictionary using list-comprehension. If you would please change these to use a pre Python 2.7 friendly implementation, then dynamodb-mapper could be used with earlier versions of Python. (I have third-party libraries in legacy code that require Python 2.6.) For example: change line 497: data = {str(key):getattr(self, str(key)) for key in schema} to: data = dict((str(key), getattr(self, str(key))) for key in schema)

and change line 710: return {key: _python_to_dynamodb(val) for key, val in data.iteritems() if val or val == 0} to: return dict((key, _python_to_dynamodb(val)) for key, val in data.iteritems() if val or val == 0)

Thanks, Greg Hunt

Comments (0)

  1. Log in to comment