Comments (3)
From [email protected] on January 03, 2009 09:40:36
The referenced line of code:
++ data = row.value
++ data['_id'] = row.id
suggests that row.value should be a dict or an object with dict-like properties.
The corresponding view docstring seems out of synch ...
print Person.by_name.map_fun
function(doc) {
emit(doc.name, doc.age);
}
Elsewhere, examples show
emit(doc.name, null);
and indeed, the raw _view output correspondingly shows value=None.
I had some success using a dict as a workaround, along the lines of the following, when defining a view:
function(doc) {
emit(doc.name, {'age':doc.age, 'name':doc.name} );
}
It's hardly a 'map back into the object' but it does avoid the Exception condition. I haven't investigated any
deeper than that simplistic change.
from couchdb-python.
From [email protected] on January 04, 2009 06:16:04
After a little more investigation ... the view in the OP's attached script doesn't support the usage in the code.
If the emit function is changed to:
emit(doc.name, doc);
then the OP's attached script executes without causing an Exception and the retrieved results do indeed
behave as User objects, e.g.
print elem.name
HTH
from couchdb-python.
From djc.ochtman on December 08, 2009 08:23:17
Looks like this isn't a couchdb-python problem.
Status: Invalid
from couchdb-python.
Related Issues (20)
- couchdb-dump: No python 3.5 support HOT 1
- `ViewResult` slicing with `datetime` object HOT 3
- Missing git tag for 1.1 HOT 1
- Support mango queries HOT 10
- HTTP basic auth is broken for accented characters HOT 2
- Server.version() broken for CouchDB 2.0 HOT 6
- Support CouchDB 2.0.0 HOT 10
- CouchDB 2.0 - syncing views make CouchDB hanging HOT 4
- Not url-encoding doc IDs in update handler call HOT 15
- Put Multiple Attachments HOT 1
- Bug when used with multiprocessing HOT 3
- `'_io.BytesIO' object is not subscriptable` when creating new document HOT 8
- More user friendly for HTTP Basic Auth HOT 2
- View Server Write Error: str, not bytes HOT 3
- config has moved in 2.0.0 HOT 4
- missing find() definition on Database class HOT 5
- [Mango query] Show warning when no matching index found. HOT 1
- Cant find a way to send headers in replication HOT 2
- End of Support ?= End Of Documentation HOT 2
- Cookie auth token error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchdb-python.