lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

ViewResults with non-dict values raise a TypeError #169

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by matthewt...@gmail.com on 3 Mar 2011 at 5:19

Attachments:

GoogleCodeExporter commented 8 years ago
Don't try to wrap Mappin with non dict value. Just use raw views api (db.view) 
instead of mappings in this case.

Original comment by daevaorn on 3 Mar 2011 at 8:20

GoogleCodeExporter commented 8 years ago
This issue has been migrated to GitHub. Please continue discussion here:

https://github.com/djc/couchdb-python/issues/169

Original comment by djc.ochtman on 15 Jul 2014 at 7:20