Skip to content

Instantly share code, notes, and snippets.

@taxilian
Created May 5, 2011 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taxilian/958125 to your computer and use it in GitHub Desktop.
Save taxilian/958125 to your computer and use it in GitHub Desktop.
couchdbkit show function support
def show(self, show_name, doc_id, **params):
""" Execute a show function on the server and return the response.
If the response is json it will be deserialized, otherwise the string
will be returned.
Args:
@param show_name: should be 'designname/showname'
@param doc_id: id of the document to pass into the show document
@param params: params of the show
"""
show_name = show_name.split('/')
dname = show_name.pop(0)
vname = '/'.join(show_name)
show_path = '_design/%s/_show/%s/%s' % (dname, vname, doc_id)
return self.res.get(show_path, **params).json_body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment