couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "paul jobs" <webjog...@gmail.com>
Subject ValueError: dictionary update sequence element #0 has length 1; 2 is required
Date Fri, 09 Jan 2009 23:52:43 GMT
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())

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message