[Dbix-class] RFC: DBIx::Class::JSON

Nilson Santos Figueiredo Junior acid06 at gmail.com
Wed Sep 20 01:18:21 CEST 2006


On 9/18/06, Robert Dobbs <bobisdobbs at hotmail.com> wrote:
> Or, if another set of 'flators could be specified for a field, would it be
> possible to build a Javascript Date object into the JSON construct, for
> example?  Some way to put in a javascript eval literal "new Date(
> ".join(',', map $dt->$_, qw( year month day hours minute second millisecond
> ) )." ); ";   # ... or something.

That's something I couldn't figure out how to do, although I tried. I
think it's something not possible to be done using JSON::Syck so I
might try the plain old pure perl JSON.

> Hrmm, well maybe it is easier to keep the terse deflated value in the JSON
> thing, and in your Javascript application you could write functions to throw
> your objects through that inflate them back into Javascript objects of other
> types.

The problem with this approach is that your JS code will need to know
about your backend's date format. Kind of messy.

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list