diff --git a/mongoengine/base/document.py b/mongoengine/base/document.py index 4792cf194..e5311c5dd 100644 --- a/mongoengine/base/document.py +++ b/mongoengine/base/document.py @@ -450,7 +450,8 @@ def to_json(self, *args, **kwargs): "No 'json_options' are specified! Falling back to " "LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. " "For use with other MongoDB drivers specify the UUID " - "representation to use.", + "representation to use. This will be changed to " + "uuid_representation=UNSPECIFIED in a future release.", DeprecationWarning, ) kwargs["json_options"] = LEGACY_JSON_OPTIONS @@ -480,7 +481,8 @@ def from_json(cls, json_data, created=False, **kwargs): "No 'json_options' are specified! Falling back to " "LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. " "For use with other MongoDB drivers specify the UUID " - "representation to use.", + "representation to use. This will be changed to " + "uuid_representation=UNSPECIFIED in a future release.", DeprecationWarning, ) kwargs["json_options"] = LEGACY_JSON_OPTIONS diff --git a/mongoengine/connection.py b/mongoengine/connection.py index 04864f38a..7852c64f1 100644 --- a/mongoengine/connection.py +++ b/mongoengine/connection.py @@ -177,7 +177,7 @@ def _get_connection_settings( "For compatibility with other MongoDB drivers this should be " "specified as 'standard' or '{java,csharp}Legacy' to work with " "older drivers in those languages. This will be changed to " - "'standard' in a future release.", + "'unspecified' in a future release.", DeprecationWarning, ) kwargs["uuidRepresentation"] = "pythonLegacy" diff --git a/mongoengine/pymongo_support.py b/mongoengine/pymongo_support.py index fcddbf7b2..5429fc90c 100644 --- a/mongoengine/pymongo_support.py +++ b/mongoengine/pymongo_support.py @@ -7,6 +7,8 @@ PYMONGO_VERSION = tuple(pymongo.version_tuple[:2]) +# This will be changed to UuidRepresentation.UNSPECIFIED in a future +# (breaking) release. if PYMONGO_VERSION >= (4,): LEGACY_JSON_OPTIONS = json_util.LEGACY_JSON_OPTIONS.with_options( uuid_representation=binary.UuidRepresentation.PYTHON_LEGACY, diff --git a/mongoengine/queryset/base.py b/mongoengine/queryset/base.py index caefa0e0f..75b2af6cb 100644 --- a/mongoengine/queryset/base.py +++ b/mongoengine/queryset/base.py @@ -1283,7 +1283,8 @@ def to_json(self, *args, **kwargs): "No 'json_options' are specified! Falling back to " "LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. " "For use with other MongoDB drivers specify the UUID " - "representation to use.", + "representation to use. This will be changed to " + "uuid_representation=UNSPECIFIED in a future release.", DeprecationWarning, ) kwargs["json_options"] = LEGACY_JSON_OPTIONS