1👍
#models.py
class Calc(models.Model):
id = models.AutoField(primary_key=True)
status = models.CharField(max_length=100),
text = models.CharField(max_length=100)
@property
def checkStatus():
return 'xxx'
#views.py
from django.views.generic import DetailView,
class Calc(DetailView):
model = Calc
#template
{{ object.checkStatus }}
👤sai
Source:stackexchange.com