From 9d4246419ca5b913a7a9b05f18e695f10a9fd0fb Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Sun, 20 Nov 2016 23:22:13 +0000 Subject: [PATCH] Refs #26207 -- Removed obsolete comments about deferred model classes. --- django/apps/config.py | 1 - django/apps/registry.py | 1 - django/db/models/base.py | 6 ------ tests/update_only_fields/tests.py | 3 +-- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/django/apps/config.py b/django/apps/config.py index 14925cd1ce..edb1146afc 100644 --- a/django/apps/config.py +++ b/django/apps/config.py @@ -179,7 +179,6 @@ class AppConfig(object): - auto-created models for many-to-many relations without an explicit intermediate table, - - models created to satisfy deferred attribute queries, - models that have been swapped out. Set the corresponding keyword argument to True to include such models. diff --git a/django/apps/registry.py b/django/apps/registry.py index 0ac495df1e..453e4d42f6 100644 --- a/django/apps/registry.py +++ b/django/apps/registry.py @@ -165,7 +165,6 @@ class Apps(object): - auto-created models for many-to-many relations without an explicit intermediate table, - - models created to satisfy deferred attribute queries, - models that have been swapped out. Set the corresponding keyword argument to True to include such models. diff --git a/django/db/models/base.py b/django/db/models/base.py index 219a1b1aa2..9364afb278 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -605,12 +605,6 @@ class Model(six.with_metaclass(ModelBase)): return hash(self._get_pk_val()) def __reduce__(self): - """ - Provides pickling support. Normally, this just dispatches to Python's - standard handling. However, for models with deferred field loading, we - need to do things manually, as they're dynamically created classes and - only module-level classes can be pickled by the default path. - """ data = self.__dict__ data[DJANGO_VERSION_PICKLE_KEY] = get_version() class_id = self._meta.app_label, self._meta.object_name diff --git a/tests/update_only_fields/tests.py b/tests/update_only_fields/tests.py index c2b809b328..7627bcd378 100644 --- a/tests/update_only_fields/tests.py +++ b/tests/update_only_fields/tests.py @@ -72,8 +72,7 @@ class UpdateOnlyFieldsTests(TestCase): s1.gender = 'M' with self.assertNumQueries(1): s1.save() - # The deferred class does not remember that gender was - # set, instead the instance should remember this. + # save() should not fetch deferred fields s1 = Person.objects.only('name').get(pk=s.pk) with self.assertNumQueries(1): s1.save()