Is there a natural way to display model methods or properties on a Django admin site? In my case, I have basic statistics for a symbol that is part of the model, but other things, such as status effects, that affect the overall calculation for this statistic:
class Character(models.Model):
base_dexterity = models.IntegerField(default=0)
@property
def dexterity(stat_name):
total = self.base_dexterity
total += sum(s.dexterity for s in self.status.all()])
return total
It would be nice if I could display the general calculated statistics with the field in order to change the basic statistics on the "Change Character" page, but it is not clear to me how to include this information in the page.
source
share