Created
May 5, 2011 22:38
-
-
Save taxilian/958125 to your computer and use it in GitHub Desktop.
couchdbkit show function support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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