Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 230 by
te...@prosauce.org: Document Update Handler (update_doc)
support for PUT and POST
http://code.google.com/p/couchdb-python/issues/detail?id=230
couchdb/client.py:
def update_doc(self, name, docid=None, **options):
"""Calls server side update handler.
:param name: the name of the update handler function in the format
``designdoc/updatename``.
:param docid: optional ID of a document to pass to the update
handler.
:param options: optional query string parameters.
:return: (headers, body) tuple, where headers is a dict of headers
returned from the list function and body is a readable
file-like instance
"""
path = _path_from_name(name, '_update')
if docid is None:
func = self.resource(*path).post
else:
path.append(docid)
func = self.resource(*path).put
_, headers, body = func(**options)
return headers, body
The Document Update Handlers API reference
(
http://docs.couchdb.org/en/latest/ddocs.html#update-functions) mentions
support for both PUT and POST. For larger updates (>650bytes) PUT is not
appropriate (HTTP 414, request too long, concerns). The module should
prefer POST or include a kwarg to allow the caller to decide the verb.
Thanks!
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings