我试图将操作结果保存在我的 admin.py 中,但出现此错误:
量化结果对于当前上下文有太多数字
....
def save_model(self, request, obj, form, change):
usuario_libra = obj.consignee.membresia.libra
valores = Valores.objects.get(pk=1)
vtasa = valores.tasa
vaduana = valores.aduana
vgestion = valores.gestion
vfee = valores.fee
vcombustible = valores.combustible
trans_aereo = obj.peso * usuario_libra * vtasa
aduana = (obj.peso * vaduana )*vtasa
fee_airpot = (obj.peso * vfee)*vtasa
combustible = (obj.peso * vcombustible)*vtasa
itbis = (trans_aereo+vgestion)*Decimal(0.16)
total = trans_aereo + vgestion + aduana + fee_airpot + combustible + itbis
if not obj.id:
obj.total = total
...
这是什么意思?,我所有的模型字段都是十进制任何帮助请
谢谢