I’m looking for a way to parse the value of integerFields and returning the value.
scoreChans = models.IntegerField(0)
scoreChansSet = models.BooleanField(False)
scoreYatzy = models.IntegerField(0)
scoreYatzySet = models.BooleanField(False)
scoreTotal = scoreChans + scoreYatzy
But this gives:
TypeError: unsupported operand type(s) for +: ‘IntegerField’ and ‘IntegerField’
Is there a way the fetch the values from these fields?
You can only fetch the values on an instantiated model.
I assume you want to have a computed property? Something like: