DESCRIPTION

Added ViewResult class for operations on view results

Change-Id: Ia43bd2ed159a27c7941fc63e4b98090c1087b4b8


COMMENTS

author: Kenny Maynard
date: 2012-04-03 04:42:27.594000000

Uploaded patch set 2.

-------------------------------------
author: Ayla Reynolds
date: 2012-04-03 10:17:33.908000000

Patch Set 2: Do not submit

(5 inline comments)

See inline comments.

Line:41, lib/couchbase/view_helper.py -> This is not correct, see comment for the get_num_rows() method. I would use len(ViewResult.get_rows(result)) instead.

Line:59, lib/couchbase/view_helper.py -> The "total_rows" are not the number of rows of the result (at least this is the case for Apache CouchDB, not sure about Couchbase though).

"total_rows" is the total number of rows of a view when you would query it without any start and end key.

I would either rename it to "total_rows" or "get_total_rows", or (if you don't need it atm) just remove.

Line:67, lib/couchbase/view_helper.py -> I personally prefer

  [d['key'].encode("ascii", "ignore") for d in items]

but that's a matter of taste, not a blocker.

Line:267, pytests/viewquerytests.py -> len(ViewResult._rows(results)). See view_helper.py:60 for more info.

Line:198, pytests/viewtests.py -> len(ViewResult._rows(results)). See view_helper.py:60 for more info. I won't add it to all occurrences in the file :)

-------------------------------------
author: Kenny Maynard
date: 2012-04-09 21:10:49.753000000

Patch Set 2: (4 inline comments)



Line:41, lib/couchbase/view_helper.py -> Fixed the function in the ViewResult class

Line:59, lib/couchbase/view_helper.py -> I wasn't aware of this and have fixed this function to return len(ViewResult.get_rows(result)

Line:267, pytests/viewquerytests.py -> Fixed the function in the ViewResult class.

Line:198, pytests/viewtests.py -> Fixed the function in the ViewResult class.

-------------------------------------
