We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Document.load()
None
1 parent 0836624 commit d0b7099Copy full SHA for d0b7099
couchdb/schema.py
@@ -200,8 +200,17 @@ def rev(self):
200
rev = property(rev)
201
202
def load(cls, db, id):
203
- """Load a specific document from the given database."""
204
- return cls.wrap(db.get(id))
+ """Load a specific document from the given database.
+
205
+ :param db: the `Database` object to retrieve the document from
206
+ :param id: the document ID
207
+ :return: the `Document` instance, or `None` if no document with the
208
+ given ID was found
209
+ """
210
+ doc = db.get(id)
211
+ if doc is None:
212
+ return None
213
+ return cls.wrap(doc)
214
load = classmethod(load)
215
216
def store(self, db):
0 commit comments