Snippet List
This is a very basic paginator for CouchDB ViewResults.
It's usage is similar to the django one.
**CouchPaginator** is almost like the django version with one exception: It's constructor needs an additional argument `pages_view` which is either a reduce result or an integer which holds the total number of objects across all pages.
*Example Map/Reduce for pages*:
> map = function(doc) {
> if(doc.type=="application" || doc.type==\"inquiry\"){
> emit([doc.meta.user.toLowerCase(), doc.type], 1);
> }
> reduce = function (doc, value, rereduce){
> return sum(value);
> }
**SimpleCouchPaginator** is much simpler and needs no total number and can only paginate by "next" and "previous" page. Use this if you don't have an reduce view which tells you the amount of total object.
An Example setup of CouchDB with django can be found at:
[Eric Florenzanos post about django+couchdb](http://www.eflorenzano.com/blog/post/using-couchdb-django/)
[See example usage](http://www.djangosnippets.org/snippets/1209/)
- pagination
- paginator
- couchdb
toke has posted 2 snippets.