mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #32421 -- Made admindocs ModelDetailView show model cached properties.
This commit is contained in:
parent
4372233ebf
commit
dcb094abe8
5 changed files with 21 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue