Giter Club home page Giter Club logo

couchdb-python's Introduction

CouchDB-Python Library

image

Note: CouchDB-Python is no longer being maintained. After 8 years of maintaining CouchDB-Python, I no longer have time to address open issues and new bug reports. Consider https://github.com/cloudant/python-cloudant as an alternative. If you're interested in taking over maintenance of CouchDB-Python, please start a discussion on the mailing list, or open an issue or PR.

A Python library for working with CouchDB. Downloads are available via PyPI. Our documentation is also hosted there. We have a mailing list.

This package currently encompasses four primary modules:

  • couchdb.client: the basic client library
  • couchdb.design: management of design documents
  • couchdb.mapping: a higher-level API for mapping between CouchDB documents and Python objects
  • couchdb.view: a CouchDB view server that allows writing view functions in Python

It also provides a couple of command-line tools:

  • couchdb-dump: writes a snapshot of a CouchDB database (including documents, attachments, and design documents) to MIME multipart file
  • couchdb-load: reads a MIME multipart file as generated by couchdb-dump and loads all the documents, attachments, and design documents into a CouchDB database
  • couchdb-replicate: can be used as an update-notification script to trigger replication between databases when data is changed

Prerequisites:

  • Python 2.7, 3.4 or later
  • CouchDB 0.10.x or later (0.9.x should probably work, as well)

simplejson will be used if installed.

couchdb-python's People

Contributors

adrienverge avatar amoore avatar atomatt avatar chadwhitacre avatar cmlenz avatar daevaorn avatar dholth avatar djc avatar djmorgul avatar dorins avatar dustin avatar elimisteve avatar geppettodivacin avatar giftig avatar gourneau avatar iandanforth avatar jab avatar jaberg avatar janl avatar jeltef avatar kxepal avatar leesper avatar magopian avatar marcelotduarte avatar mmoya avatar rdbisme avatar ryanolson avatar tammoippen avatar tilgovi avatar tsipinio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

couchdb-python's Issues

Failure when creating empty attachments

From [email protected] on November 25, 2008 20:47:25

The following trace occurs when trying to create an empty attachment:

ERROR: test_empty_attachment (couchdb.tests.client.DatabaseTestCase)

Traceback (most recent call last):
File "/home/jason/src/couchdb-python/couchdb/tests/client.py", line 89,
in test_empty_attachment
self.db.put_attachment(doc, '', 'empty.txt')
File "/home/jason/src/couchdb-python/couchdb/client.py", line 442, in
put_attachment
}, rev=doc['_rev'])
File "/home/jason/src/couchdb-python/couchdb/client.py", line 834, in put
**params)
File "/home/jason/src/couchdb-python/couchdb/client.py", line 860, in
_request
resp, data = _make_request()
File "/home/jason/src/couchdb-python/couchdb/client.py", line 855, in
_make_request
body=body, headers=headers)
File "build/bdist.linux-i686/egg/httplib2/init.py", line 1050, in request
File "build/bdist.linux-i686/egg/httplib2/init.py", line 854, in _request
File "build/bdist.linux-i686/egg/httplib2/init.py", line 824, in
_conn_request
File "/usr/lib/python2.5/httplib.py", line 928, in getresponse
response.begin()
File "/usr/lib/python2.5/httplib.py", line 385, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.5/httplib.py", line 349, in _read_status
raise BadStatusLine(line)
BadStatusLine

It seems that httplib doesn't send a Content-Length header when the content
body is ''. The attached patch contains a test and also a one-line fix
that simply adds the Content-Length header.

Attachment: patch.diff

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=34

Database.update does not pass its doctests

From [email protected] on June 26, 2008 16:20:21

What steps will reproduce the problem? 1. Do the doctests in client.py:333
2. It will fails miserably 3. What is the expected output? What do you see instead? Expected:
<Document u'...'@U'...' {'type': 'Person', 'name': 'John Doe'}>
<Document u'...'@U'...' {'type': 'Person', 'name': 'Mary Jane'}>
<Document u'...'@U'...' {'type': 'City', 'name': 'Gotham City'}>
Instead:
(500, (u'EXIT', u'{{badmatch,{{obj,[{"type","Person"},{"name","John
Doe"}]},\n {obj,[{"type","Person"},{"name","Mary Jane"}]},\n
{obj,[{"type","City"},{"name","Gotham City"}]}}},\n
[{couch_httpd,handle_db_request,3},\n {couch_httpd,handle_request,2},\n
{mochiweb_http,headers,4},\n {proc_lib,init_p,5}]}')) What version of the product are you using? On what operating system? 0.8.0 Please provide any additional information below. Maybe it's a server problem

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=17

db["index.html"] isn't happy

From [email protected] on October 14, 2008 02:52:43

What steps will reproduce the problem? 1. Use the couchdb web interface to create a database
2. Create a document in the database called "index.html"
3. try to access it w/ the library What is the expected output? What do you see instead? I was trying to store the contents of an HTML file in a document entry
called index.html
May not be a legal couchdb action What version of the product are you using? On what operating system? couchdb - Apache CouchDB 0.8.0-incubating Please provide any additional information below.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=25

Calling len() on a ViewResult raises an Exception

From [email protected] on November 03, 2008 07:09:54

I call a named view and then check the number of results by calling len().

I receive the following traceback:

if len(result) == 0:
File "build/bdist.linux-i686/egg/couchdb/client.py", line 722, in len
return len(self.rows)
File "build/bdist.linux-i686/egg/couchdb/client.py", line 733, in _get_rows
self._fetch()
File "build/bdist.linux-i686/egg/couchdb/client.py", line 727, in _fetch
for r in data['rows']]
TypeError: string indices must be integers

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=30

_fetch fails with map/reduce views (KeyError: 'id')

From yoan.blanc on June 05, 2008 18:16:51

What steps will reproduce the problem? 1. create some documents
2. run a map/reduce view, like: http://damienkatz.net/2008/02/incremental_map.html 3. try to print the rows What is the expected output? What do you see instead? # HTTP Response
{"rows":[{"key":"Batiste","value":1},{"key":"Yoan","value":2}]}

traceback

Traceback (most recent call last):
File "data.py", line 65, in
for message in messages:
File "build/bdist.linux-i686/egg/couchdb/client.py", line 548, in iter
File "build/bdist.linux-i686/egg/couchdb/client.py", line 567, in _get_rows
File "build/bdist.linux-i686/egg/couchdb/client.py", line 561, in _fetch
KeyError: 'id' What version of the product are you using? On what operating system? couchdb-python: r71 couchdb: r663055 Please provide any additional information below. I patched it very quickly but I assume that CouchDB API isn't finished at
this time.

Attachment: client.patch

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=11

Add log() function to view server

From [email protected] on July 15, 2008 17:55:13

What steps will reproduce the problem? 1. place a call to log() inside python view code What is the expected output? What do you see instead? Expected: log output in the couchdb log.
Instead: Error output from the view server Please use labels and text to provide additional information. Possible Solution:
Inject a log() function into the locals dictionary when evaluating view code.

See http://wiki.apache.org/couchdb/ViewServer for what should be outputted
back to CouchDB by the log() function.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=21

Feature request: allow subclasses of couchdb.schema.Document control over their couchdb ID (i.e. PUT not POST)

From [email protected] on May 17, 2008 22:54:10

Currently subclasses of couchdb.schema.Document have to accept the CouchDB
id that's given to them; Document.store calles Database.create, which is
hard coded to POST to couchdb, meaning that couchdb generates an ID.

Need to have control over the ID e.g. if I define a property called id for
my subclass of Document, it's value is used to PUT to couchdb.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=9

Exception mapping view results to Object derived from schema.Document

From [email protected] on November 29, 2008 23:02:53

What steps will reproduce the problem? 1. couchdb from source, svn Revision: 720997
2. couchdb-python from source, svn Revision: 130
3. python 2.6 on mac os x 10.5
4. run the att'd script: python break.py Please provide any additional information below. run the att'd script and you'll see that there's an exception thrown in mapping view results back to
the User object that is derived from schema.

Attachment: break.py

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=38

Can't create a named document

From [email protected] on October 14, 2008 03:25:36

What steps will reproduce the problem? 1. db.create({'_id': 'hi', 'contents':'ho'})
u'f37d8d5594fa8dd9b0c4642269275343'

db["hi"]
Traceback (most recent call last):
File "", line 1, in
File
"/usr/lib/python2.5/site-packages/CouchDB-0.4-py2.5.egg/couchdb/client.py",
line 253, in getitem
File
"/usr/lib/python2.5/site-packages/CouchDB-0.4-py2.5.egg/couchdb/client.py",
line 646, in get
File
"/usr/lib/python2.5/site-packages/CouchDB-0.4-py2.5.egg/couchdb/client.py",
line 688, in _request
couchdb.client.ResourceNotFound: (u'not_found', u'missing') What is the expected output? What do you see instead? Personally (and tied w/ a previous comment) I'd expect to be able to create
documenta via;
db["new_doc"] = { 'contents': 'foo', 'bar' : True }
but I could understand if that needed to be;
db.create( '_id': "new_doc", 'contents': 'foo', 'bar' : True) What version of the product are you using? On what operating system? >>> couchdb.version
'0.4' Please provide any additional information below. BTW though I love the library! I'm not the code guy I'd like to be but it's
been helpful to actually be able to read your code (it's taught me about
couchdb's REST API and python too).

Thanks for the work!

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=26

replication_helper should pull from source instead of pushing to each target

From [email protected] on January 08, 2009 20:16:41

pull-based replication results is a faster, more efficient process because of request pipelining.
Here's a patch:

--- a/couchdb/tools/replication_helper.py
+++ b/couchdb/tools/replication_helper.py
@@ -63,9 +63,9 @@ class ReplicationHelper(object):

     # send replication request to target server
     for target_server in self.args.target_servers: 
  •        body['target'] = self.concat_uri(target_server, database)
    
  •        body['target'] = database
         self.http.request(
    
  •            self.concat_uri(self.args.source_server, '_replicate'), 
    
  •            self.concat_uri(target_server, '_replicate'), 
             'POST', 
             body=json.dumps(body, ensure_ascii=False))
    

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=46

Server.__getitem__ does not raise ResourceNotFound when database does not exist.

From [email protected] on December 17, 2008 20:26:27

What steps will reproduce the problem? 1. Create a couchdb server object

import couchdb
s = couchdb.client.Server('http://localhost:5984/'

  1. 'get' a database from the server which does not exist yet.

    db = s['foobar'] What is the expected output? What do you see instead? Expect a ResourceNotFound exception. Instead a Database object is returned. What version of the product are you using? On what operating system? 0.5, Ubuntu Linux 8.04 Please provide any additional information below. Patch is attached below.

Attachment: Server.getitem.patch

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=41

'unicode' object is not callable

From [email protected] on January 01, 2008 03:04:44

My model:

import couchdb.client as couch
import couchdb.schema as couch
import datetime as datetime

class Foo(couch.Document):
ip = couch.TextField()
lastPolled = couch.DateTimeField(default = datetime.datetime.now())

My code:
node = Foo.Foo(ip = '67.202.38.207')
node.store(db)
return node.id()

I get the following exception:
TypeError: 'unicode' object is not callable

Any ideas?

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=4

Initializing document with empty dic fails

From [email protected] on March 15, 2008 22:32:59

db['people'] = {}

returns:

[info] [<0.47.0>] HTTP Request: PUT /strigo-data/people HTTP/1.1
[info] [<0.47.0>] HTTP Error (code 500): {obj,[{error,"EXIT"},
{reason,"{function_clause,[{cjson,tokenize,\n
[[],{decoder,utf8,null,1,1,any}]},\n
{cjson,decode1,2},\n {cjson,json_decode,2},\n
{mod_couch,handle_doc_put,2},\n
{mod_couch,do,1},\n {httpd_response,traverse_modules,2},\n
{httpd_response,generate_and_send_response,1},\n
{httpd_request_handler,handle_response,1}]}"}]}
[info] [<0.47.0>] HTTP Response Code:500

---- solution ----

line 628 in client.py
it does "if content:", which is gonna be false on your empty dict
yep
it should be "if not content is None:"
so yes it does end up doing an empty put
which is bad
you can post the bug and include that :)

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=7

How do I link the python view server to couchdb?

From [email protected] on July 09, 2008 22:36:04

What steps will reproduce the problem? 1. try to run couchdb w/ python cod 2. 3. What is the expected output? What do you see instead? What version of the product are you using? On what operating system? 0.8-incubading Please provide any additional information below. I know I need to edit; /usr/local/etc/couchdb/couch.ini
and add a line to the [Couch Query Servers] section
But I'm unsure what that should be;

python=python -e couchdb "couchdb.run()"

Doesn't seem to work, but it may be because I'm not sure about the python
view syntax itself...

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=20

Using Database.__setitem__ with JSON string bug

From [email protected] on July 04, 2008 03:18:55

test.py

import couchdb
server = couchdb.Server("http://localhost:5984"
db = server.create('test')
db['doc'] = '{ "foo": "bar" }'

causes:

Traceback (most recent call last):
File "test.py", line 4, in
db['doc'] = '{ "foo": "bar" }'
File "build/bdist.linux-x86_64/egg/couchdb/client.py", line 264, in
setitem
AttributeError: 'str' object has no attribute 'update'

It would appear that Database.setitem assumes that the passed document
is a dict object.

Attached a trivial patch.

Attachment: patch.diff

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=18

validate_dbname does not enforce database names starting with characters

From [email protected] on December 17, 2008 20:33:37

What steps will reproduce the problem? 1. Create a couchdb Server object

import couchdb
s = couchdb.client.Server('http://localhost:5984/'

  1. Create a Database where the name doesn't start with a-z

    db = s['999'] What is the expected output? What do you see instead? Should raise an exception that the database name is invalid, instead the
    Database object is returned What version of the product are you using? On what operating system? Version 0.5. Ubuntu Linux 8.04 Please provide any additional information below. Patch attached

Attachment: validate_dbname.patch

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=42

Download URL for development version needed for easy_install

From [email protected] on November 27, 2008 09:54:57

Hello,

I need to make CouchDB-FUSE depend on CouchDB >= 0.5dev- r125 , but at the
moment easy_install can't find a development version of couchdb-python to
download. I believe the solution is as easy as providing a link to the SVN
repository, with something like "#egg=CouchDB-0.5dev" appended to it.

If this could be added it would make installing the current version of
CouchDB-FUSE a lot easier.

Thanks,

Jason

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=36

Add required fields

From [email protected] on June 12, 2008 05:43:28

It would be helpful to be able to programmatically add some constraints to
Couchdb data. The Python schema classes provide a nice place to do this.

Attached is a patch that adds an optional "required" parameter to fields.
When set to True, all instances must be created with a value for that field
(whether loaded from a database or created manually). When created manually
the initial value must be passed during construction. This also works with
default values as you would expect.

If this patch (or something like it) is accepted I'll also create a similar
patch that lets you specify an "options" parameter for fields that will
constrain values to only those values.

Attachment: schema.diff

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=15

Query metadata?

From [email protected] on November 07, 2007 03:34:25

Right now, if you submit a query with "count=0", with either client.query
or client.view, you are unable to access the metadata for the results; both
functions make that data inaccessible.

To fix it, I added a meta() function to the View class and a viewmeta(self,
name, **options) function to the Database class.

I will submit a patch if you'd like; I'm not sure how you want to implement
this functionality.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=1

FeatureRequest: Allow use of schema.Document objects for x_attachment operations

From [email protected] on January 10, 2009 23:48:33

When using the put_attachment method, you can't use a schema.document
object directly, you need to requery the db for a document(list). It would
be nice to be able to just use your schema.document object instead. What is the expected output? What do you see instead? foo = Foo(bar=1,baz=2)
foo.store(db)
db.put_attachment(foo,f,fName) What version of the product are you using? On what operating system? couchdb-python 0.5 Please provide any additional information below. I've already implemented part of it -- the put_attachment modification.
I'll supply a patch shortly

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=49

can't get result from a "reduce"

From [email protected] on June 20, 2008 02:21:38

What steps will reproduce the problem? 1. Make a view with a reduce function
2. Query it with Db.view function 3. What is the expected output? What do you see instead? KeyIndex 'id' exception is raised. Which is normal because a reduce view
don't provide id key, nor total_rows result. What version of the product are you using? On what operating system? latest trunk (0.8-incubing) Please provide any additional information below. Find here a quick patch that solve it.

Attachment: couchdb-python.diff

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=16

Can't access resources with slashes in their names

From [email protected] on November 17, 2007 16:23:45

Trying to access a document with a name like books/1 causes a GET request
like this: GET /library/books/1 HTTP/1.1 . This is an error, because
documents can't have slashes in their names. On the other hand, if you try
to access books%2F1, the result requested resource is /library/books%252F1
, which isn't much better.

I changed the signature of the uri function to accept a flag that specifies
whether or not it should quote slashes and created two new wrapper
functions, id_uri (specifies that slashes must be quoted) and view_uri
(specifies that slashes mustn't be quoted.)

I'm attaching a patch against revision 44 .

Attachment: couchdb-python-uri-quote.patch

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=3

ListFields can not be assigned to ListFields

From [email protected] on June 12, 2008 03:11:05

Assigning one ListField instance to another converts the data from a json
compatible list to an AnonymousStruct Schema instance. Repro:

class Post(Model):
title = TextField()
content = TextField()
pubdate = DateTimeField(default=datetime.now)
comments = ListField(DictField(Schema.build(
author = TextField(),
content = TextField(),
time = DateTimeField()
)))

post = Post(title='Foo bar')
post.comments.append(author='myself', content='Bla bla',
time=datetime.now())
print post.comments
post.comments = post.comments
print post.comments

You should see that the second print of post.comments is wrong. This
happens because ListField._to_json does not correctly convert a Proxy to
json data.

One possible solution is attached. Very small patch, but it sure took me a
while to figure out given the nested nature of DictField and ListField.

Attachment: schema.diff

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=14

Checking if a database is in a server shouldn't throw an exception

From [email protected] on October 20, 2008 19:11:04

What steps will reproduce the problem? 1. server = couchdb.Server(url)
2. dbname = 'db-which-doesnt-exist'
3. dbname in server What is the expected output? What do you see instead? False

I see:

couchdb.client.ServerError: (500, (u'error', u'not_found')) What version of the product are you using? On what operating system? 0.4 Please provide any additional information below.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=27

Creation of new DB is akward

From ulises.cervino on September 21, 2008 13:23:41

What steps will reproduce the problem? 1. wrong way of going about it (although more intuitive for me)
def create_db(server, name):
try:
return server[name]
except KeyError:
return server.create(name)
2. right way (works):
def create_db(server, name):
if name in server:
return server[name]
else:
return server.create(name)

print create_db(server, 'test') outputs: <Database 'test'> in both cases
print [x for x in server] outputs all dbs but 'test' if using fn 1

Ideally I would expect the Exception KeyError to be raised by accessing the
server dict if the db didn't exist in the first implementation. What version of the product are you using? On what operating system? couchdb 0.8.1, svn couchdb-python

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=24

[maybe bug?] Bulk update does not execute unless return value is iterated

From [email protected] on February 06, 2008 23:36:14

def update(self, documents):
documents = list(documents)
data = self.resource.post('_bulk_docs', content=documents)
for idx, result in enumerate(data['results']):
assert 'ok' in result # FIXME: how should error handling work here?
doc = documents[idx]
doc.update({'_id': result['id'], '_rev': result['rev']})
yield doc

This won't perform the POST until the first result is asked for. I'm not
sure if this is a bug or intentional as iterating the result has other side
effects too. It just seemed a bit spooky and confused me for a while.

If iterating is optional, I think something like the following would
make sure the update is always called when the function is called while
preserving the current usage.

def update(self, documents):
documents = list(documents)
data = self.resource.post('_bulk_docs', content=documents)
def foo():
for idx, result in enumerate(data['results']):
assert 'ok' in result # FIXME: how should error handling
work here?
doc = documents[idx]
doc.update({'_id': result['id'], '_rev': result['rev']})
yield doc
return foo()

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=5

client.Document vs schema.Document

From [email protected] on December 04, 2008 02:40:37

Hello,

This is not an issue but a question. I could not find a discussion group or
a mailing list, please direct me if this isn't the appropriate forum.

I'm trying to understand how to use client.Document and schema.Document
objects in couchdb-python. For my use I don't need to map JSON documents to
python objects. However, I'm finding it cumbersome to convert responses
from the database to schema.Document objects in order to have access to
general purpose methods such as load, store and items. The similar names
also complicates keeping track of the class of an object.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=40

Timeout error - should it be handled by auto-retry stuff?

From [email protected] on October 26, 2008 10:39:00

I get the following traceback occasionally. I'm wondering whether this
should be handled using the auto-retry stuff?

File "/home/jason/django_projects/netspade/blog/model.py", line 32, in
num_comments
rows = list(db.view('_view/comments/count', group=True)[self.id])

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 722, in len
return len(self.rows)

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 733, in _get_rows
self._fetch()

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 725, in _fetch
data = self.view._exec(self.options)

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 621, in _exec
resp, data = self.resource.get(**self._encode_options(options))

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 801, in get
return self._request('GET', path, headers=headers, **params)

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 836, in _request
resp, data = _make_request()

File "/usr/lib/python2.5/site-packages/CouchDB-0.5dev_r117-
py2.5.egg/couchdb/client.py", line 831, in _make_request
body=body, headers=headers)

File "/usr/lib/python2.5/site-packages/httplib2-0.4.0-
py2.5.egg/httplib2/init.py", line 1050, in request

File "/usr/lib/python2.5/site-packages/httplib2-0.4.0-
py2.5.egg/httplib2/init.py", line 854, in _request

File "/usr/lib/python2.5/site-packages/httplib2-0.4.0-
py2.5.egg/httplib2/init.py", line 824, in _conn_request

File "/usr/lib/python2.5/httplib.py", line 928, in getresponse
response.begin()

File "/usr/lib/python2.5/httplib.py", line 385, in begin
version, status, reason = self._read_status()

File "/usr/lib/python2.5/httplib.py", line 343, in _read_status
line = self.fp.readline()

File "/usr/lib/python2.5/socket.py", line 372, in readline
data = recv(1)

timeout: timed out

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=29

replication_helper doesn't handle create/delete

From ulises.cervino on October 22, 2008 15:23:12

What steps will reproduce the problem? 1. configure couchdb to use replication_helper.py as update notifier
2. create a db in a 'slave' couchdb What is the expected output? What do you see instead? Expected would be the replication_helper to create the db on the target
server. Instead nothing happens. What version of the product are you using? On what operating system? CouchDB 0.9.0a706617-incubating
Linux dyc-ucbdesk 2.6.24-21-generic #1 SMP Mon Aug 25 16:57:51 UTC 2008
x86_64 GNU/Linux Please provide any additional information below.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=28

Setting the _id field is not passed on to the DB

From [email protected] on December 03, 2008 19:26:17

Hello,
Sorry if I'm missing something obvious, I only started playing with CouchDB yesterday, and it's been a long
week... ;)

If I create a document object:

dataset = client.Document()
dataset['_id'] = "/CSA07AllEvents/CMSSW_1_6_9-FastSim-1204301968/AOD"
dataset['key'] = ["/CSA07AllEvents/CMSSW_1_6_9-FastSim-1204301968/AOD", 0]
db.create(dataset)

I would expect that the _id of the object, once created in the db, would be the same as what I set it to. At the
moment it is lost, and a new one auto generated.

Likewise, if I do something like:

doc = {
... "_id": "the id I generate",
... "key": ["the id I generate", 0]
... }
db['thing'] = doc

the _id in the dictionary is over ridden by the db['thing'](though I can understand that).

I guess this would mean changing the Database.create() method, and given that's a short but sweet method
maybe this isn't practical. Doing the db['id I want'] is fine, but I think it would be neater if this was wrapped up in
the Document object (maybe it is and I'm missing something obvious...).

I ask because the application I'm evaluating using Couchdb (and it's python interface) for will have a lot of
GUID's already in place, and I don't really want/need a new one.
Cheers
Simon

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=39

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.