I am working with a couchdbkit Document object like this:
class MyDoc(Document):
property = ...
I want to fetch this document with a list of properties:
all_docs = MyDoc.view('db/myview')
And having the view results object like this brings an exception while iterating over it.
DocTypeError |
Exception Value: | the document being wrapped has doc type None. To wrap it anyway, you must explicitly pass in classes={None: <document class>} to your view. This behavior is new starting in 0.6.2. |
---|
I have add the explicit class declaration.
all_docs = MyDoc.view('db/myview', classes={None: MyDoc})
This was ok for fetching all the docs.
However I was fetching docs providing key's for the view like so:
all_docs = MyDoc.view(
'db/myview',
classes={None: MyDoc},
key=property
)
Now this construction seem to have stop working.
Attention Question! :)
Am I querying this in a right manner?
Maybe new functionality did provide another method to do this kind of stuff?