I am using an awesome library called Django Auditlog. It tracks what changes occurred to an object. For model Book if I changed the Author name from 'John' to 'Mary' it records the before value (John), after value (Mary), when it occurred, and what user made the change.
It's working except that it is detecting changes that aren't changes for some of my decimal fields. It thinks a change occurs anytime I save this model: it thinks that I started with .00 and changed it to .0. But .00 is the existing value and I didn't change anything. I just saved() the record.
I checked the output of the form itself in the clean() method:
services_sub_total
44.00
sum_payments
33.00
And then in the database:
I just can't figure out where/why this is detecting only one zero in the decimal place - I'm not seeing that .0 anywhere. So I'm wondering what is happening between the clean() method and the commit that might be truncating the .00 to .0 where Auditlog might be incorrectly detecting a change?