IMHO, the default JSONEncoder need not be serialized into javascript
Date objects, otherwise it is troublesome when using in non-js
situation. But we can have another subclass, say JSONEncoderForJs, for
that purpose. See also the docstring of JSONEncoder:
To extend this to recognize other objects, subclass and implement
a
``.default()`` method with another method that returns a
serializable
object for ``o`` if possible, otherwise it should call the
superclass
implementation (to raise ``TypeError``).
On May25, 7:27am, mdipierro <[email protected]> wrote:
> yes it does in the sense that you can serialize date, datetime and
> time objects using web2py's simplejson but they are serialized into
> isostrings, not javascript date objects. Should they be serialized
> into javascript Date objects? pros? Cons?
>
> Massimo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---