incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Sobolev <mikhail.sobo...@gmail.com>
Subject Re: couchdb.http.PreconditionFailed: ('missing_stub', ...)
Date Tue, 06 Apr 2010 18:51:15 GMT
Hi,

(Sorry to follow up myself)

On Tue, Apr 6, 2010 at 9:41 PM, Mikhail Sobolev
<mikhail.sobolev@gmail.com> wrote:
>>> My bet is on you try updating or deleting a document without passing in a valid
_rev.
>> The code used to work.
> The funny thing is that the code that throws the exception
> (src/couchdb/couch_doc.erl:364) was written in November last year...
OK, I played a bit with the code I sent previous (fap.py) and it
turned out that the following change is done:
-        doc['_attachments'][filename] = dict(stub=True, revpos=doc.rev)
+        doc['_attachments'][filename] = dict(stub=True,
revpos=int(doc.rev.split('-')[0]))

everything starts to work as it used to without revpos.

--
Misha

PS  The main reason why I did the code like this is because I did not
want to download the whole document every time any of its attachments
are downloaded.

Mime
View raw message