Python client delete design doc
Not sure if I've found a bit of unfinished functionality in the Python client; to delete design docs.
import couchbase
cb = couchbase.Server('localhost:8091', username='Administrator', password='password')
bucket = cb['epic']
bucket.delete('_design/place')
[2012-09-17 12:55:32,828] - [rest_client] [140735157635424] - ERROR - http://192.168.10.100:8092/epic/_design/_design/place error 400 reason: bad_request {"error":"bad_request","reason":"attachments not supported in Couchbase"}
Traceback (most recent call last):
File "unregister.py", line 4, in
bucket.delete('_design/place')
File "/Volumes/DATA/dv/epic/server/venv/lib/python2.7/site-packages/couchbase/client.py", line 263, in delete
rest.delete_view(self.name, view)
AttributeError: 'RestConnection' object has no attribute 'delete_view'
rest_client.py:214 does define delete_design_doc(self, bucket, design_doc) but this is never called.
Server is 2.0.0. I've updated the python client to 0.8.0 and the problem remains although with a different error message;
File "/Volumes/DATA/dv/epic/server/venv/lib/python2.7/site-packages/couchbase/client.py", line 254, in delete
rest.delete_view(self.name, view)
AttributeError: 'RestConnection' object has no attribute 'delete_view'
I think the problem lies simply within the Python client; inspecting client.py:254 there's a call to a non existent function delete_view().. probably should be RestConnection.delete_design_doc().
This isn't expected. I've filed an issue to track this:
http://www.couchbase.com/issues/browse/PYCBC-68
Question: what version of the server are you using? There had been some changes to design doc management not too long ago. I would expect 0.8.0 python client and server 2.0 beta will work together just fine.