add support for working with pytz object field #717
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a pytz object is serialized it fails with this error
TypeError: Object of type Africa/Abidjan is not JSON serializable
and this issue has already been reported (for example #248)The current workaround is to modify the methods in the pytz serializer field, but it becomes more complicated when other third party libraries in the project are also broken because of this.
So I think it is reasonable to assume that because any bigger real project will require working with a timezone, it's better to fix the problem here instead of making modifications on various fields and libraries. And it's just a few lines fix.
Also I'm not sure if this change requires tests and if they are needed where should I add them?
Thanks