ListProperty(dict) doesn't work
Closed this issue · 1 comments
dannyroberts commented
>>> from jsonobject import *
>>> class Foo(JsonObject):
... dict_list = ListProperty(dict)
...
>>> Foo(dict_list=[{}])
Foo(dict_list=[{}])
>>> Foo({'dict_list': [{}]})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/droberts/.virtualenvs/gmail-filters/lib/python2.7/site-packages/jsonobject/base.py", line 608, in __init__
self.set_raw_value(key, value)
File "/Users/droberts/.virtualenvs/gmail-filters/lib/python2.7/site-packages/jsonobject/base.py", line 641, in set_raw_value
wrapped = self.__wrap(key, value)
File "/Users/droberts/.virtualenvs/gmail-filters/lib/python2.7/site-packages/jsonobject/base.py", line 687, in __wrap
if isinstance(property_, JsonContainerProperty) else {})
File "/Users/droberts/.virtualenvs/gmail-filters/lib/python2.7/site-packages/jsonobject/base.py", line 161, in wrap
obj, wrapper=wrapper, string_conversions=string_conversions)
File "/Users/droberts/.virtualenvs/gmail-filters/lib/python2.7/site-packages/jsonobject/base.py", line 291, in __init__
super(JsonArray, self).append(self._wrapper.wrap(item))
File "/Users/droberts/.virtualenvs/gmail-filters/lib/python2.7/site-packages/jsonobject/base.py", line 159, in wrap
), self.container_class
AssertionError: <class 'jsonobject.base.JsonDict'>
dannyroberts commented
Fixed in 0.6.0b1! Ha!