dimagi/commcare-hq — pull request #4386 by dannyroberts (2014-09-24 18:08:09+00:00)
Title: Save timezone

@czue @snopoke

I'm opening this for preliminary review. (Let me know if you think there's a better workflow than opening a PR that we don't intend to merge. I like to do this sometimes to get feedback on a direction I'm going when I'm about half-way.)

Might want to scan the diff first and then review commit by commit.

Here's my progress so far:

[x] Make `jsonobject` support replacing default handlers https://github.com/dimagi/jsonobject/pull/97
[x] Write an `ISO8601Property` that accepts any valid ISO date/datetime and translates it to UTC, and saves up to microseconds. (Lenient input, strict output.)
[x] Make XFormInstance use the `ISO8601Property` exclusively (both for explicit properties and dynamic properties)
[x] Mark XFormInstances processed the new way with a `is_timezone_aware` flag set to true
[ ] Make CommCareCases use the new property exclusively
[ ] Write script to reprocess form xml (using the changes feed or a view that iterates through all forms)
[ ] Write a script that reprocesses all cases with affected forms (might as well be all cases). Verify that this has the expected behavior of updating the case actions to include the timezone-modified dates