added explicit warnings when calling methods having no effect anymore with PyMongo3+
This commit is contained in:
parent
9b2fde962c
commit
3ab5ba6149
@ -939,6 +939,9 @@ class BaseQuerySet(object):
|
|||||||
..versionchanged:: 0.5 - made chainable
|
..versionchanged:: 0.5 - made chainable
|
||||||
.. deprecated:: Ignored with PyMongo 3+
|
.. 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 = self.clone()
|
||||||
queryset._snapshot = enabled
|
queryset._snapshot = enabled
|
||||||
return queryset
|
return queryset
|
||||||
@ -962,6 +965,9 @@ class BaseQuerySet(object):
|
|||||||
|
|
||||||
.. deprecated:: Ignored with PyMongo 3+
|
.. 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 = self.clone()
|
||||||
queryset._slave_okay = enabled
|
queryset._slave_okay = enabled
|
||||||
return queryset
|
return queryset
|
||||||
|
Loading…
x
Reference in New Issue
Block a user