Converts a queryset to JSON
(self, *args, **kwargs)
| 1315 | # JSON Helpers |
| 1316 | |
| 1317 | def to_json(self, *args, **kwargs): |
| 1318 | """Converts a queryset to JSON""" |
| 1319 | if "json_options" not in kwargs: |
| 1320 | warnings.warn( |
| 1321 | "No 'json_options' are specified! Falling back to " |
| 1322 | "LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. " |
| 1323 | "For use with other MongoDB drivers specify the UUID " |
| 1324 | "representation to use. This will be changed to " |
| 1325 | "uuid_representation=UNSPECIFIED in a future release.", |
| 1326 | DeprecationWarning, |
| 1327 | ) |
| 1328 | kwargs["json_options"] = LEGACY_JSON_OPTIONS |
| 1329 | return json_util.dumps(self.as_pymongo(), *args, **kwargs) |
| 1330 | |
| 1331 | def from_json(self, json_data): |
| 1332 | """Converts json data to unsaved objects""" |