mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #32421 -- Made admindocs ModelDetailView show model cached properties.
This commit is contained in:
committed by
Mariusz Felisiak
parent
4372233ebf
commit
dcb094abe8
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user