On Apr 30, 5:30 pm, Alberto Valverde <[EMAIL PROTECTED]> wrote:
> This happens because the "jsonify" generic function has no built-in
> rules to handle widgets. To work around it you could do:
>
> from turbojson import jsonify
> from turbogears.widgets import Widget
>
> @jsonify.when("isinstance(obj, Widget")
> def jsonify_widget(obj):
>         return None

Brilliant - thanks. :)

Just in case anybody looks at this in the future here's the same thing
with two minor bugs fixed:

from turbojson.jsonify import jsonify
from turbogears.widgets import Widget

@jsonify.when("isinstance(obj, Widget)")
def jsonify_widget(obj):
    return None

The bugs surely mean you wrote that from memory - yikes - wish I could
remember all the libraries as well as you.

Regards,
AJ


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to