couchdb-python icon indicating copy to clipboard operation
couchdb-python copied to clipboard

Enhancement: “show” and “list” functionality

Open djc opened this issue 10 years ago • 1 comments

From [email protected] on June 13, 2009 18:33:20

This patch allows you to write “list” and “show” functions in python. It enables you to deliver ready-to-use content straight out of the CouchDB instance (bypassing the application server). Basic tests are also included.

Works with CouchDB 0.9.x branch and trunk

More docs: http://wiki.apache.org/couchdb/Formatting_with_Show_and_List Example functions:

“show” function:

def fun(doc, req): tpl = '

%s

' data = doc['name'] return {'body': tpl % data, 'headers': {'Content-Type': 'text/html'}}

“list” function:

def fun(head,row,req,row_info): if head: return 'My list:' elif row: return row['value'] else: return 'end-of-list\n'

Attachment: show_and_list.patch.txt

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=78

djc avatar Jul 12 '14 14:07 djc

From djc.ochtman on December 14, 2009 02:30:28

Labels: -Type-Defect Type-Enhancement

djc avatar Jul 12 '14 14:07 djc