diff --git a/django/contrib/gis/db/models/proxy.py b/django/contrib/gis/db/models/proxy.py index 06d64873d99..282109b7254 100644 --- a/django/contrib/gis/db/models/proxy.py +++ b/django/contrib/gis/db/models/proxy.py @@ -17,7 +17,7 @@ class SpatialProxy(DeferredAttribute): self._field = field self._klass = klass self._load_func = load_func or klass - super().__init__(field.attname, klass) + super().__init__(field.attname) def __get__(self, instance, cls=None): """ diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 188b5bb907e..6ddd8f033ab 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -719,7 +719,7 @@ class Field(RegisterLookupMixin): # if you have a classmethod and a field with the same name, then # such fields can't be deferred (we don't have a check for this). if not getattr(cls, self.attname, None): - setattr(cls, self.attname, DeferredAttribute(self.attname, cls)) + setattr(cls, self.attname, DeferredAttribute(self.attname)) if self.choices: setattr(cls, 'get_%s_display' % self.name, partialmethod(cls._get_FIELD_display, field=self)) diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index 62b67e61310..1dcf22fda8d 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -115,7 +115,7 @@ class DeferredAttribute: A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed. """ - def __init__(self, field_name, model): + def __init__(self, field_name): self.field_name = field_name def __get__(self, instance, cls=None):