lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

__setitem__ in client.Database #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in __setitem__ in client.Database:

def __setitem__(self, id, content)

if 'content' has attributes '_rev' and '_id', perhaps it could do an update
instead of assuming its new?

Original issue reported on code.google.com by hoi...@gmail.com on 20 Aug 2008 at 2:19

GoogleCodeExporter commented 8 years ago
+1

Original comment by goofyhea...@gmail.com on 3 Sep 2008 at 12:46

GoogleCodeExporter commented 8 years ago
It does not assume the document is new.

  >>> doc = {'title': 'Foo'}
  >>> db['foo'] = doc
  >>> db['foo']
  <Document u'foo'@u'951974093' {u'title': u'Foo'}>
  >>> doc['title'] = 'Bar'
  >>> db['foo'] = doc
  >>> db['foo']
  <Document u'foo'@u'275614698' {u'title': u'Bar'}>

I'm not sure what behavior you're seeing. Please reopen and describe in detail 
if the above does not work for 
you.

Original comment by cmlenz on 8 Sep 2008 at 3:36