大家好,我的问题是:
模型.py
class Plant(models.Model)
nominal_power = models.PositiveIntegerField()
module_nominal_power= models.PositiveIntegerField()
@property
def no_modules(self):
return round(self.nominal_power*1000/self.module_nominal_power)
视图.py
^{pr2}$我得到一个错误:无法将关键字“no_modules”解析为字段。无法将关键字“no_modules”解析为字段。
我不明白失败的意义,但我怎样才能得到总数呢?在
也许用F类
@Marcin你是对的,但我在找这个:
相关问题 更多 >
编程相关推荐