Open vied12 opened 12 years ago
Do you have a working test case so I can figure out what is the issue ?
Maybe I upgrade pymongo or mongokit, but the following code doesn'ty work anymore with the latest versions
#!/usr/bin/env python
# Encoding: utf-8
import mongokit, datetime
connection = mongokit.Connection()
@connection.register
class News(mongokit.Document):
__collection__ = 'news'
__database__ = 'test'
structure = {
'title' : unicode,
}
i18n = ['title']
use_dot_notation = True
if __name__ == "__main__":
connection.test.news.remove()
news = connection.News()
news.title = u"[en] pouet"
news.set_lang("fr")
news.title = u"[fr] pouet"
news.save()
all_news = connection.test.news.find()
print list(all_news)
I have
Traceback (most recent call last):
File "testCase.py", line 20, in <module>
news.title = u"[en] pouet"
File "/home/edouard/.local/lib/python2.7/site-packages/mongokit/schema_document.py", line 362, in __setattr__
self[key][self._current_lang] = value
TypeError: 'NoneType' object does not support item assignment
It works with mongokit 0.7.2
and pymongo 2.0.1
I'm also getting this error ( "self[key][self._current_lang] = value" ), but can't find the 0.7.2 version of mongokit anymore so I can't verify if it's working with that version.
@vied12 : Did you solve this issue?
When I try :
news is a cursor, I have this error:
Do you have any idea of what happens ?