Skip to content

Commit 0da158c

Browse files
committed
Fix id and rev for some special documents
Some special documents (e.g. _security) have no id or rev, this results in an error when trying to get them. This is done in the __repr__ so these documents can not be printed.
1 parent 03187e1 commit 0da158c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

couchdb/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,15 +1011,16 @@ def id(self):
10111011
10121012
:rtype: basestring
10131013
"""
1014-
return self['_id']
1014+
return self.get('_id')
1015+
10151016

10161017
@property
10171018
def rev(self):
10181019
"""The document revision.
10191020
10201021
:rtype: basestring
10211022
"""
1022-
return self['_rev']
1023+
return self.get('_rev')
10231024

10241025

10251026
class View(object):

0 commit comments

Comments
 (0)