@@ -371,46 +371,37 @@ def store(self, db):
371371 db [self .id ] = self ._data
372372 return self
373373
374- def query (cls , db , map_fun , reduce_fun , language = 'javascript' ,
375- eager = False , ** options ):
374+ def query (cls , db , map_fun , reduce_fun , language = 'javascript' , ** options ):
376375 """Execute a CouchDB temporary view and map the result values back to
377376 objects of this schema.
378377
379378 Note that by default, any properties of the document that are not
380379 included in the values of the view will be treated as if they were
381- missing from the document. If you'd rather want to load the full
382- document for every row, set the `eager` option to `True`, but note that
383- this will initiate a new HTTP request for every document, unless the
384- ``include_docs`` option is explitly specified.
380+ missing from the document. If you want to load the full document for
381+ every row, set the ``include_docs`` option to ``True``.
385382 """
386383 def _wrapper (row ):
387- if eager :
388- if row .doc is not None :
389- return row .doc
390- return cls .load (db , row .id )
384+ if row .doc is not None :
385+ return cls .wrap (row .doc )
391386 data = row .value
392387 data ['_id' ] = row .id
393388 return cls .wrap (data )
394389 return db .query (map_fun , reduce_fun = reduce_fun , language = language ,
395390 wrapper = _wrapper , ** options )
396391 query = classmethod (query )
397392
398- def view (cls , db , viewname , eager = False , ** options ):
393+ def view (cls , db , viewname , ** options ):
399394 """Execute a CouchDB named view and map the result values back to
400395 objects of this schema.
401396
402397 Note that by default, any properties of the document that are not
403398 included in the values of the view will be treated as if they were
404- missing from the document. If you'd rather want to load the full
405- document for every row, set the `eager` option to `True`, but note that
406- this will initiate a new HTTP request for every document, unless the
407- ``include_docs`` option is explitly specified.
399+ missing from the document. If you want to load the full document for
400+ every row, set the ``include_docs`` option to ``True``.
408401 """
409402 def _wrapper (row ):
410- if eager :
411- if row .doc is not None :
412- return row .doc
413- return cls .load (db , row .id )
403+ if row .doc is not None : # include_docs=True
404+ return cls .wrap (row .doc )
414405 data = row .value
415406 data ['_id' ] = row .id
416407 return cls .wrap (data )
0 commit comments