[Fixed]-Test django model attribute values – e.g. Decimal

1👍

from decimal import Decimal

attr = getattr(instance, key)
if isinstance(attr, Decimal):    
    value = Decimal(str(value))
if attr != value:
    ...

Leave a comment