add testcase and changelog for pull:#1020 'improve _created status when switch collection and db'

This commit is contained in:
Breeze.kay
2015-06-19 15:40:05 +08:00
parent 0bbbbdde80
commit dfc7f35ef1
4 changed files with 84 additions and 0 deletions

View File

@@ -503,6 +503,10 @@ class Document(BaseDocument):
:param str db_alias: The database alias to use for saving the document
:param bool keep_created: keep self._created value after call `swith_db()` when True,
else will always set self._created value to True
.. seealso::
Use :class:`~mongoengine.context_managers.switch_collection`
if you need to read from another collection
@@ -531,6 +535,10 @@ class Document(BaseDocument):
:param str collection_name: The database alias to use for saving the
document
:param bool keep_created: keep self._created value after call `swith_db()` when True,
else will always set self._created value to True
.. seealso::
Use :class:`~mongoengine.context_managers.switch_db`
if you need to read from another database