Message from discussion
couchdb.mapping.Document rev attribute
Received: by 10.14.211.196 with SMTP id w44mr2355963eeo.0.1342536541081;
Tue, 17 Jul 2012 07:49:01 -0700 (PDT)
X-BeenThere: couchdb-python@googlegroups.com
Received: by 10.14.27.200 with SMTP id e48ls167090eea.8.gmail; Tue, 17 Jul
2012 07:48:59 -0700 (PDT)
Received: by 10.14.211.196 with SMTP id w44mr2355912eeo.0.1342536539524;
Tue, 17 Jul 2012 07:48:59 -0700 (PDT)
Received: by 10.14.211.196 with SMTP id w44mr2355910eeo.0.1342536539510;
Tue, 17 Jul 2012 07:48:59 -0700 (PDT)
Return-Path: <kxe...@gmail.com>
Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53])
by gmr-mx.google.com with ESMTPS id s44si12512017eeo.0.2012.07.17.07.48.59
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 17 Jul 2012 07:48:59 -0700 (PDT)
Received-SPF: pass (google.com: domain of kxe...@gmail.com designates 74.125.83.53 as permitted sender) client-ip=74.125.83.53;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of kxe...@gmail.com designates 74.125.83.53 as permitted sender) smtp.mail=kxe...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-ee0-f53.google.com with SMTP id e52so193846eek.12
for <couchdb-python@googlegroups.com>; Tue, 17 Jul 2012 07:48:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=eBrKBxiVCXIFMXzoMiF8bxZ5dir6457NY3whW/OZKdY=;
b=qPLaqhiXHjhbUhKaCZthklCm6grlGbNN8ZtQGVCBDkgjev29KNmNpwfQHJtXJclb2V
biZMbX5HF47RLT9kfblb/ol23x6MEzVi2GTvYnWKorsjkuX36NiuNYhdIzZhXZMl/xx1
d+OuoejrY8AV/jmxzxyGzJqAxV9HxNlplT+F7mJ6DIOxn0oYHV2EFoWwjRC68MIkX+uV
g5n3U++yILjCJkk+6WmuWqS+1jn6KsB580gy7ToW+4wlfjqG8zozOisEh285GTEJ1++U
akZTNz88ltdRzpEGYweSlCW6mzfZburIkkJDVFPGTDo1qbDX/zLVChVcGeN/2komBvHw
Nr5g==
MIME-Version: 1.0
Received: by 10.14.211.200 with SMTP id w48mr3423217eeo.6.1342536539342; Tue,
17 Jul 2012 07:48:59 -0700 (PDT)
Received: by 10.14.208.137 with HTTP; Tue, 17 Jul 2012 07:48:59 -0700 (PDT)
In-Reply-To: <5e740455-a01e-415e-93d3-f214a71906e0@googlegroups.com>
References: <5e740455-a01e-415e-93d3-f214a71906e0@googlegroups.com>
Date: Tue, 17 Jul 2012 18:48:59 +0400
Message-ID: <CAHdjip+Eyy5oUvtr5QfjXFgCDhj02FguAAkNpsC2gPbH2w+...@mail.gmail.com>
Subject: Re: couchdb.mapping.Document rev attribute
From: Alexander Shorin <kxe...@gmail.com>
To: couchdb-python@googlegroups.com
Content-Type: text/plain; charset=UTF-8
Hi Adam!
Mostly because this is system internal field, that not supposed to be
touched by clients. Accidental his changing may create unexpectable
conflict situations.
To create mapping.Document instance based on view result you have two ways:
1. Use ViewField to gain result data and Document class as result row wrapper.
2. Wrap view result manually by Document class on instance
initialization. Document revision would be automatically set by `_rev`
key parameter.
--
,,,^..^,,,
On Tue, Jul 17, 2012 at 5:51 PM, adam.cajf <adam.c...@gmail.com> wrote:
> I'd like to know why rev property of the couchdb.mapping.Document class is
> read-only attribute. Even id attribute can be set, and I need in my project
> to create a new Document with rev, which I obtain from CouchDB view. I know
> that rev is generated in CouchDB, but that's a pity that creators didn't
> predict such an exception. Moreover, in my humble opinion there should be a
> get method for the Document class that could obtain many ids as a paramter.
>
> --
> You received this message because you are subscribed to the Google Groups
> "CouchDB-Python" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/couchdb-python/-/t0XgDS2BQBkJ.
> To post to this group, send email to couchdb-python@googlegroups.com.
> To unsubscribe from this group, send email to
> couchdb-python+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/couchdb-python?hl=en.