Samuel Baldwin
unread,Sep 22, 2010, 8:51:40 AM9/22/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CouchDB-Python
Howdy; just started using CouchDB-Python, but unfortunately I've
already run into an error. When I'm defining a mapping between a
couchdb document and a python object with class, load and store don't
work. I've confirmed (by looping through 'id in db') that I'm actually
connecting to the database and there's actually data there that the
library can read; this only fails with .mapping.
This is what my code looks like, seems pretty straightforward.
>>> from couchdb import Server, Document
>>> from couchdb.mapping import TextField
>>> server = Server()
>>> db = server['opettelukortit']
>>> class Sana(Document):
... suomi = TextField()
... englanti = TextField()
...
>>> s = Sana.load(db, 'da6bd85034c58b2ae1466f9af20016c6')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'Sana' has no attribute 'load'
>>>