1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

Refs #28909 -- Simplifed code using unpacking generalizations.

This commit is contained in:
Mariusz Felisiak
2018-02-26 18:23:31 +01:00
committed by GitHub
parent 5b589a47b9
commit 074a2f7f58
8 changed files with 19 additions and 34 deletions

View File

@@ -219,9 +219,7 @@ class QuerySet:
def __getstate__(self):
# Force the cache to be fully populated.
self._fetch_all()
obj_dict = self.__dict__.copy()
obj_dict[DJANGO_VERSION_PICKLE_KEY] = get_version()
return obj_dict
return {**self.__dict__, DJANGO_VERSION_PICKLE_KEY: get_version()}
def __setstate__(self, state):
msg = None