New issue 169 by matthewt...@gmail.com: ViewResults with non-dict values
raise a TypeError
http://code.google.com/p/couchdb-python/issues/detail?id=169
What steps will reproduce the problem?
1. Create a ViewResults object from a view where the values are something
that isn't a dict - ie. string, int, etc.
2. Attempt to iterate over the results.
What is the expected output? What do you see instead?
I should be able to define a view that contains non-dict values and access
those values at row['value']. Instead, I get a TypeError
What version of the product are you using? On what operating system?
Mercurial
Please provide any additional information below.
I've attached a patch that modifies the _wrap_row classmethod to handle
instances where the row value is non-dict. Where the value is not a dict,
the except TypeError block is executed, which sets the data value to the
value of the non-dict row.
Attachments:
mapping-patch.diff 464 bytes
Don't try to wrap Mappin with non dict value. Just use raw views api
(db.view) instead of mappings in this case.