@@ -233,6 +233,8 @@ def __init__(self, design, map_fun, reduce_fun=None,
233
233
def __get__ (self , instance , cls = None ):
234
234
if self .wrapper is DEFAULT :
235
235
def wrapper (row ):
236
+ if row .doc is not None :
237
+ return cls .wrap (row .doc )
236
238
data = row .value
237
239
data ['_id' ] = row .id
238
240
return cls .wrap (data )
@@ -340,10 +342,13 @@ def query(cls, db, map_fun, reduce_fun, language='javascript',
340
342
included in the values of the view will be treated as if they were
341
343
missing from the document. If you'd rather want to load the full
342
344
document for every row, set the `eager` option to `True`, but note that
343
- this will initiate a new HTTP request for every document.
345
+ this will initiate a new HTTP request for every document, unless the
346
+ `include_docs` option is explitly specified.
344
347
"""
345
348
def _wrapper (row ):
346
349
if eager :
350
+ if row .doc is not None :
351
+ return row .doc
347
352
return cls .load (db , row .id )
348
353
data = row .value
349
354
data ['_id' ] = row .id
@@ -360,10 +365,13 @@ def view(cls, db, viewname, eager=False, **options):
360
365
included in the values of the view will be treated as if they were
361
366
missing from the document. If you'd rather want to load the full
362
367
document for every row, set the `eager` option to `True`, but note that
363
- this will initiate a new HTTP request for every document.
368
+ this will initiate a new HTTP request for every document, unless the
369
+ `include_docs` option is explitly specified.
364
370
"""
365
371
def _wrapper (row ):
366
372
if eager :
373
+ if row .doc is not None :
374
+ return row .doc
367
375
return cls .load (db , row .id )
368
376
data = row .value
369
377
data ['_id' ] = row .id
0 commit comments