I'm trying to store and retrieve user from the database _users
using couchdb-python
. I'm a beginner here with couchdb
.
I mapped the python class User with couchdb Document couchdb.mapping.Document
like this:
import couchdb.mapping as cmap
class User(cmap.Document):
name = cmap.TextField()
password = cmap.TextField()
type = 'user'
roles = {}
but this is not working. I got doc.type must be user
ServerError
so probably the way I'm declaring the type is not correct.
How should I construct my class to be used with the _users
database?