Skip to content

Instantly share code, notes, and snippets.

@thruflo
Created December 6, 2009 12:24
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 thruflo/250197 to your computer and use it in GitHub Desktop.
Save thruflo/250197 to your computer and use it in GitHub Desktop.
>>> from couchdbkit import Server
>>>
>>> # server object
... server = Server()
>>>
>>> # create database
... db = server.get_or_create_db('foo')
>>> db
<Database foo>
>>> db['bar'] = {'a': 1}
>>> db['bar'] = {'a': 2}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/env/github/digest/env/lib/python2.5/site-packages/couchdbkit-0.2.4-py2.5.egg/couchdbkit/client.py", line 738, in __setitem__
self.save_doc(doc)
File "/env/github/digest/env/lib/python2.5/site-packages/couchdbkit-0.2.4-py2.5.egg/couchdbkit/client.py", line 404, in save_doc
res = self.res.put(docid, payload=doc, _raw_json=_raw_json, **params)
File "build/bdist.macosx-10.3-i386/egg/restkit/rest.py", line 223, in put
File "/env/github/digest/env/lib/python2.5/site-packages/couchdbkit-0.2.4-py2.5.egg/couchdbkit/resource.py", line 166, in request
response=e.response)
couchdbkit.resource.ResourceConflict: o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment