lanto03 / couchdb-python

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

Deprecated method used in the documentation #137

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Following the Getting Started section of the official documentation for 
version 0.7
2. At line 25 of doc/getting-started.rst
3. I got a warning: 
In [7]: db.create(doc)
/usr/local/bin/ipython:1: DeprecationWarning: Database.create is deprecated, 
please use Database.save instead [2010-04-13]
  #!/usr/bin/python
Out[7]: '00e78e9066d4541a81830e05cbe66e96'

What is the expected output? What do you see instead?
The method "Database.save" should be used in the documentation.

What version of the product are you using? On what operating system?
0.7, OS X 10.6.3

Please provide any additional information below.

Original issue reported on code.google.com by rhcarva...@gmail.com on 23 Jun 2010 at 2:01

GoogleCodeExporter commented 8 years ago
There's more. After using create, my dict "doc" was not changed like in the 
documentation (it did not contain _id nor _rev keys).
Using Database.save however returned a tuple with _id and _rev, and upon 
inspecting the variable "doc" it contained the expected keys.

From my ipython console:

In [7]: db.create(doc)
/usr/local/bin/ipython:1: DeprecationWarning: Database.create is deprecated, 
please use Database.save instead [2010-04-13]
  #!/usr/bin/python
Out[7]: '00e78e9066d4541a81830e05cbe66e96'  

In [8]: couchdb.__version__
Out[8]: '0.7'

In [9]: doc
Out[9]: {'loved': 'Olusia', 'lover': 'Rodolfo'}

In [10]: db.save(doc)
Out[10]: ('c92dc3d1b2570d1d915d587f47196c5c', 
'1-fd43ca41a0e5d0104ab5facf2de2190a')

In [11]: doc
Out[11]: 
{'_id': 'c92dc3d1b2570d1d915d587f47196c5c',
 '_rev': '1-fd43ca41a0e5d0104ab5facf2de2190a',
 'loved': 'Olusia',
 'lover': 'Rodolfo'}

Original comment by rhcarva...@gmail.com on 23 Jun 2010 at 2:06

GoogleCodeExporter commented 8 years ago
Thanks for reporting this. I've just updated the doc to call Database.save and 
updated the expected output. It should now be correct and consistent.

Original comment by matt.goo...@gmail.com on 23 Jun 2010 at 2:25