[Tutor] couchdb.mapping 'Document' class

Emanuel Lauria emanuel.lauria at gmail.com
Tue Mar 1 16:19:02 CET 2011


Hi everyone,

I'm trying to map a couchdb document to a python object using couchdb.mapping. I'm stuck in the very first part were it says I should declare a Python class that inherits from the 'Document'.. Where does this 'Document' superclass comes from? I can't resolve it. Or do I have to create it? How? Could someone point me in to the right direction?

>>> import couchdb

>>> class Person(Document):
...     name = TextField()
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Document' is not defined


Thanks for your help, and please forgive me if im too n00b in this. I havent found any documentation except http://packages.python.org/CouchDB/mapping.html which is not enough.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110301/7a86d153/attachment.html>


More information about the Tutor mailing list