Answer the question
In order to leave comments, you need to log in
How to resolve error with DecimalField?
Hello everyone, there is django 1.7 there is postgre. There is this field:
balance_rur = models.DecimalField(u"Баланс рубли", max_digits=15, decimal_places=2, default=0)
if currency == RUR:
self.balance_rur = models.F('balance_rur') + amount
elif currency == USD:
self.balance_usd = models.F('balance_usd') + amount
self.save(update_fields=['balance_rur', "balance_usd"])
self.save(update_fields=['balance_rur', "balance_usd"])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question