--- a/server/python/junius/model.py
+++ b/server/python/junius/model.py
@@ -64,16 +64,19 @@ class CouchDB(paisley.CouchDB):
# directly does?
body = json.dumps(ob, allow_nan=False,
ensure_ascii=False).encode('utf-8')
return self.post(uri, body)
def openView(self, *args, **kwargs):
# The base class of this returns the raw json object - eg:
# {'rows': [], 'total_rows': 0}
+ # XXX - Note that paisley isn't interested in this enhancement, so
+ # we need to remove it...
+
# *sob* - and it also doesn't handle encoding options...
return super(CouchDB, self).openView(*args, **_encode_options(kwargs)
).addCallback(_raw_to_rows)
def openDoc(self, dbName, docId, revision=None, full=False, attachment=""):
# paisley appears to use an old api for attachments?
if attachment:
uri = "/%s/%s/%s" % (dbName, docId, attachment)
@@ -124,22 +127,22 @@ class CouchDB(paisley.CouchDB):
factory = HTTPClientFactory(url, **kwargs)
from twisted.internet import reactor
reactor.connectTCP(self.host, self.port, factory)
d = factory.deferred
# ** end of self._getPage clone **
d.addCallback(self.parseResult)
return d
- def updateDocuments(self, dbName, docs):
+ def updateDocuments(self, dbName, user_docs):
# update/insert/delete multiple docs in a single request using
# _bulk_docs
# from couchdb-python.
docs = []
- for doc in docs:
+ for doc in user_docs:
if isinstance(doc, dict):
docs.append(doc)
elif hasattr(doc, 'items'):
docs.append(dict(doc.items()))
else:
raise TypeError('expected dict, got %s' % type(doc))
url = "/%s/_bulk_docs" % dbName
body = json.dumps({'docs': docs})