Fixed #32421 -- Made admindocs ModelDetailView show model cached properties.

This commit is contained in:
Ramon Saraiva 2021-02-10 09:33:57 -03:00 committed by Mariusz Felisiak
parent 4372233ebf
commit dcb094abe8
5 changed files with 21 additions and 4 deletions

View file

@ -3,6 +3,7 @@ Models for testing various aspects of the djang.contrib.admindocs app
"""
from django.db import models
from django.utils.functional import cached_property
class Company(models.Model):
@ -56,6 +57,10 @@ class Person(models.Model):
def a_property(self):
return 'a_property'
@cached_property
def a_cached_property(self):
return 'a_cached_property'
def suffix_company_name(self, suffix='ltd'):
return self.company.name + suffix