niwibe/djorm-pgarray — pull request #49 by kevinmarsh (2014-11-10 17:58:58+00:00)
Title: Fixed empty TextArrayFields always being marked as 'has_changed'

I ran into a problem where I was using a `TextArrayField` and every time I saved the form (in the admin) with no value in the field, it was marking the field as changed even though it was remaining empty.

I tracked it down to `BaseForm.changed_data` in `django/forms/forms.py`. The `initial_value` of the `ArrayFormField` is `[]` but the `data_value` is `u''` which is triggering the `Field._has_changed`.

This was causing problems with `django-reversion` but probably is causing problems anywhere that `_has_changed` or `changed_data` is being used. This patch works for my case for `TextArrayField`, but further tests may be required for other `ArrayField` types or ones with dimensions > 1.