[patch] History always records changes to boolean fields
|Reported by:||vitaliyf||Owned by:||nobody|
|Cc:||cmlenz@…, brian@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a model with a "flagfield = models.BooleanField(default=False)" field. I am using a plain vanilla admin to edit it, with data stored in a MySQL 5.0.x database.
The admin works fine and all fields are updated properly. However, it looks like "Changed flagfield." entries are added to history even if the value (checkbox) was not changed.
I know very little (read: nothing) about Django internals, but it appears that there is some inconsistency with boolean fields - sometimes they are numeric (0/1) and sometimes they are True/False. db/models/manipulators.py line 113 does the comparison and I see it comparing str(1) with str(True) which fails and thus adds the field to change history.
Quite possibly there are other side-effects from this besides history.
Change History (9)
comment:2 Changed 10 years ago by
|Summary:||History always records changes to boolean fields → [patch] History always records changes to boolean fields|