Merge pull request #821 from 3lnc/Document.switch_docstring_fix

Fixes #811. Fixes reflinks
This commit is contained in:
Wilson Júnior 2014-12-04 09:28:11 -02:00
commit 8485b12102

View File

@ -456,10 +456,11 @@ class Document(BaseDocument):
user.switch_db('archive-db')
user.save()
If you need to read from another database see
:class:`~mongoengine.context_managers.switch_db`
:param str db_alias: The database alias to use for saving the document
:param db_alias: The database alias to use for saving the document
.. seealso::
Use :class:`~mongoengine.context_managers.switch_collection`
if you need to read from another collection
"""
with switch_db(self.__class__, db_alias) as cls:
collection = cls._get_collection()
@ -482,11 +483,12 @@ class Document(BaseDocument):
user.switch_collection('old-users')
user.save()
If you need to read from another database see
:class:`~mongoengine.context_managers.switch_db`
:param collection_name: The database alias to use for saving the
:param str collection_name: The database alias to use for saving the
document
.. seealso::
Use :class:`~mongoengine.context_managers.switch_db`
if you need to read from another database
"""
with switch_collection(self.__class__, collection_name) as cls:
collection = cls._get_collection()