Package couchdbkit :: Module client :: Class ViewResults
[hide private]
[frames] | no frames]

Class ViewResults

source code

object --+
         |
        ViewResults

Object to retrieve view results.

Instance Methods [hide private]
 
__init__(self, fetch, arg, wrapper, schema, params)
Constructor of ViewResults object
source code
 
iterator(self) source code
 
first(self)
Return the first result of this query or None if the result doesn’t contain any row.
source code
 
one(self, except_all=False)
Return exactly one result or raise an exception.
source code
 
all(self)
return list of all results
source code
 
count(self)
return number of returned results
source code
 
fetch(self)
fetch results and cache them
source code
 
fetch_raw(self)
retrive the raw result
source code
 
_fetch_if_needed(self) source code
 
__getitem__(self, key) source code
 
__iter__(self) source code
 
__len__(self) source code
 
__nonzero__(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  total_rows
return number of total rows in the view
  offset
current position in the view

Inherited from object: __class__

Method Details [hide private]

__init__(self, fetch, arg, wrapper, schema, params)
(Constructor)

source code 

Constructor of ViewResults object

Parameters:
  • view - Object inherited from :mod:`couchdbkit.client.view.ViewInterface
  • params - params to apply when fetching view.
Overrides: object.__init__

first(self)

source code 

Return the first result of this query or None if the result doesn’t contain any row.

This results in an execution of the underlying query.

one(self, except_all=False)

source code 

Return exactly one result or raise an exception.

Raises `couchdbkit.exceptions.MultipleResultsFound` if multiple rows are returned. If except_all is True, raises `couchdbkit.exceptions.NoResultFound` if the query selects no rows.

This results in an execution of the underlying query.


Property Details [hide private]

total_rows

return number of total rows in the view

Get Method:
unreachable.total_rows(self) - return number of total rows in the view

offset

current position in the view

Get Method:
unreachable.offset(self) - current position in the view