mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #26207 -- Removed obsolete comments about deferred model classes.
This commit is contained in:
parent
cc1f6f26b6
commit
9d4246419c
@ -179,7 +179,6 @@ class AppConfig(object):
|
|||||||
|
|
||||||
- auto-created models for many-to-many relations without
|
- auto-created models for many-to-many relations without
|
||||||
an explicit intermediate table,
|
an explicit intermediate table,
|
||||||
- models created to satisfy deferred attribute queries,
|
|
||||||
- models that have been swapped out.
|
- models that have been swapped out.
|
||||||
|
|
||||||
Set the corresponding keyword argument to True to include such models.
|
Set the corresponding keyword argument to True to include such models.
|
||||||
|
@ -165,7 +165,6 @@ class Apps(object):
|
|||||||
|
|
||||||
- auto-created models for many-to-many relations without
|
- auto-created models for many-to-many relations without
|
||||||
an explicit intermediate table,
|
an explicit intermediate table,
|
||||||
- models created to satisfy deferred attribute queries,
|
|
||||||
- models that have been swapped out.
|
- models that have been swapped out.
|
||||||
|
|
||||||
Set the corresponding keyword argument to True to include such models.
|
Set the corresponding keyword argument to True to include such models.
|
||||||
|
@ -605,12 +605,6 @@ class Model(six.with_metaclass(ModelBase)):
|
|||||||
return hash(self._get_pk_val())
|
return hash(self._get_pk_val())
|
||||||
|
|
||||||
def __reduce__(self):
|
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 = self.__dict__
|
||||||
data[DJANGO_VERSION_PICKLE_KEY] = get_version()
|
data[DJANGO_VERSION_PICKLE_KEY] = get_version()
|
||||||
class_id = self._meta.app_label, self._meta.object_name
|
class_id = self._meta.app_label, self._meta.object_name
|
||||||
|
@ -72,8 +72,7 @@ class UpdateOnlyFieldsTests(TestCase):
|
|||||||
s1.gender = 'M'
|
s1.gender = 'M'
|
||||||
with self.assertNumQueries(1):
|
with self.assertNumQueries(1):
|
||||||
s1.save()
|
s1.save()
|
||||||
# The deferred class does not remember that gender was
|
# save() should not fetch deferred fields
|
||||||
# set, instead the instance should remember this.
|
|
||||||
s1 = Person.objects.only('name').get(pk=s.pk)
|
s1 = Person.objects.only('name').get(pk=s.pk)
|
||||||
with self.assertNumQueries(1):
|
with self.assertNumQueries(1):
|
||||||
s1.save()
|
s1.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user