Skip to content

JSON serialisation fails if models have timestamp objects as values. #23

@smn

Description

@smn

We should probably change the field type to just work with iso-strings (so we can json encode easily) but provide helpers for getting the actual datetime object.

>>> page = PageModel(modified_at='2014-09-19T00:00:00.000+00:00')
>>> print page.modified_at
'2014-09-19T00:00:00.000+00:00'
>>> print page.modified_at.datetime()
datetime.datetime(2014, 9, 19, 00, 00, 00, 000, tzinfo=tzoffset(None, 0))
>>>

Not having this caused major issues in Vumi.

@hodgestar & @jerith any suggestions from you guys considering the Vumi trouble?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions