histrio/py-couchdb

uuid.uuid4().hex useless?

dedalus2000 opened this issue · 1 comments

Pycouchdb doesn't need the uuid module as far couchdb provides a good "_id" if it is not present in the document at first save.
The couchdb's _id is guaranteed to be unique in the -single- db.

I see in the "save" function:
..
self.resource(_doc['_id']).put(data=data)
..

that should become similar to the following if "_id" not in doc:
self.resource().post(data=data)

Similar update for save_bulk

Hmm in some couchdb documentation reccomends use self generated key instead of auto generated couchdb key, for this reason I use python uuid to generate a key if these does not exist.