Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use field.to_python to do django type conversions on the field before…
… checking if dirty. This solves issues where you might have a decimal field that you write a string to, eg: >>> m = MyModel.objects.get(id=1) >>> m.my_decimal_field Decimal('1.00') >>> m.my_decimal_field = u'1.00' # from a form or something >>> m.is_dirty() # currently evaluates to True, should evaluate to False False This pull request could probably use some unit testing, but it should be safe as the base class for django fields defines to_python as: def to_python(self, value): return value So, any field type that does not have an explicit to_python method will behave as before this change.
- Loading branch information