heynemann / motorengine

Motorengine is a port of MongoEngine for Tornado.
http://motorengine.readthedocs.org
204 stars 67 forks source link

ListField raises TypeError on load #70

Closed FPurchess closed 10 years ago

FPurchess commented 10 years ago
Traceback (most recent call last):
  [...]
    instance = yield MyDocument.get(id__exact=_id)
  [...]
  File "/local/lib/python2.7/site-packages/motorengine/queryset.py", line 285, in handle
    doc = self.__klass__.from_son(instance)
  File "/local/lib/python2.7/site-packages/motorengine/document.py", line 59, in from_son
    field_values[field.name] = cls._fields[field.name].from_son(value)
  File "/local/lib/python2.7/site-packages/motorengine/fields/list_field.py", line 62, in from_son
    return list(map(self._base_field.from_son, value))
TypeError: argument 2 to map() must support iteration

How to reproduce it:

FPurchess commented 10 years ago

Bugfix: https://github.com/heynemann/motorengine/pull/71