You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by paul jobs <we...@gmail.com> on 2009/01/10 00:52:43 UTC

ValueError: dictionary update sequence element #0 has length 1; 2 is required

Hey guys
This error keeps coming again and again. Anyone encounter this error in
couchdb python.


Error
Exception in thread Thread-373:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/threading.py", line 446, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/mark/work/common/utils.py", line 270, in newfunc
    return func(*a, **kw)
  File "/home/common/couchmodel.py", line 127, in savenotification
    oc.store(couchdb)
  File "build/bdist.linux-i686/egg/couchdb/schema.py", line 331, in store
    self._data = db.get(docid)
  File "build/bdist.linux-i686/egg/couchdb/client.py", line 365, in get
    return Document(data)
ValueError: dictionary update sequence element #0 has length 1; 2 is
required

The code:
def savenotification(fromuser,touser, link, message, activity, image, *args,
**kwargs):
    oc=NotificationPop( fromuser = fromuser,touser=touser, link=link,
message=message, activity=activity, image = image)
    oc.store(couchdb)

class NotificationPop(Document):
    unread = BooleanField(default=True)
    activity = TextField()
    image = TextField()
    type = TextField(default='notification')
    fromuser = TextField()
    touser = TextField()
    link = TextField()
    message = TextField()
    created = DateTimeField(default=datetime.datetime.now())
    time =TimeField(default=datetime.datetime.now())
    date = DateField(default=datetime.date.today())