﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29970	"Using cached_property on a model fails with: ""Cannot use cached_property instance without calling __set_name__() on it."""	Collin Anderson	Sergey Fedoseev	"With Python 3.6.7 (on Ubuntu 18.04), I'm getting this error for a fairly standard use of `cached_property`:

`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?"	Bug	closed	Utilities	dev	Release blocker	fixed		cmawebsite@… Sergey Fedoseev Thomas Grainger Matt Westcott	Accepted	1	0	0	0	0	0
