added explicit warnings when calling methods having no effect anymore with PyMongo3+

This commit is contained in:
mrigal 2015-04-29 15:51:17 +02:00 committed by Matthieu Rigal
parent 9b2fde962c
commit 3ab5ba6149

View File

@ -939,6 +939,9 @@ class BaseQuerySet(object):
..versionchanged:: 0.5 - made chainable
.. deprecated:: Ignored with PyMongo 3+
"""
if IS_PYMONGO_3:
msg = ("snapshot is deprecated as it has no impact when using PyMongo 3+.")
warnings.warn(msg, DeprecationWarning)
queryset = self.clone()
queryset._snapshot = enabled
return queryset
@ -962,6 +965,9 @@ class BaseQuerySet(object):
.. deprecated:: Ignored with PyMongo 3+
"""
if IS_PYMONGO_3:
msg = ("slave_okay is deprecated as it has no impact when using PyMongo 3+.")
warnings.warn(msg, DeprecationWarning)
queryset = self.clone()
queryset._slave_okay = enabled
return queryset