`TypeError: Cannot use cached_property instance without calling
__set_name__() on it.`
{{{
class MyModel(models.Model):
@cached_property
def my_method(self):
return 'test'
}}}
I assume this was broken by #29478. Maybe Django's custom `__new__` code
for models breaks the `__set_name__` hook?
--
Ticket URL: <https://code.djangoproject.com/ticket/29970>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Sergey Fedoseev, Thomas Grainger (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29970#comment:1>
* status: new => assigned
* owner: nobody => Sergey Fedoseev
--
Ticket URL: <https://code.djangoproject.com/ticket/29970#comment:2>
Comment (by Carlton Gibson):
Just noting, this is a Release Blocker for 2.2 (first release including
06076999026091cf007d8ea69146340a361259f8, fix from #29478).
--
Ticket URL: <https://code.djangoproject.com/ticket/29970#comment:3>
* cc: Matt Westcott (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29970#comment:4>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/10763 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29970#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a68ea231012434b522ce45c513d84add516afa60" a68ea23]:
{{{
#!CommitTicketReference repository=""
revision="a68ea231012434b522ce45c513d84add516afa60"
Fixed #29970, #30041 -- Made ModelBase.__new__() pass attrs without
contribute_to_class() to type.__new__().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29970#comment:6>