fusionbox/django-fusionbox — pull request #28 by colinta (2012-04-04 17:07:33+00:00)
Title: More json support, but a little magical.

More json support

This adds support for generic json using a `to_json` method. I'm using it to
encode a form so I can use it in javascript:

var tmpl = _chz.my_template({
'member': {{ member_form|json }},
'us_states': {{ us_states|json }}
});

But this could be accomplished a different way:

var tmpl = _chz.my_template({
'member': {{ member_form.to_json }},
'us_states': {{ us_states|json }}
});

But if you wanted to jsonify a dict that has objects in it, it might be nice to control the json output.

Open for discussion!