Skip to content

Commit

Permalink
Add documentation for #88
Browse files Browse the repository at this point in the history
  • Loading branch information
honzakral committed May 11, 2015
1 parent 8ae9227 commit ecbd230
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/persistence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ To retrieve an existing document use the ``get`` class method:
# and save the changes into the cluster again
first.save()
If the document is not found in elasticsearch an exception
(``elasticsearch.NotFoundError``) will be raised. If you wish to return
``None`` instead just pass in ``ignore=404`` to supress the exception:

.. code:: python
p = Post.get(id='not-in-es', ignore=404)
p is None
All the information about the ``DocType``, including its ``Mapping`` can be
accessed through the ``_doc_type`` attribute of the class:

Expand Down

0 comments on commit ecbd230

Please sign in to comment.