Hey people,
sorry to bother you guys again. I have another question.
Is there a way to detect the tg_format argument to a controller
method?
Now, if I have a controller method, with @expose("json") which returns
a dict(form=DataGird(fields=fields),value=value)
and then call that controller with ?tg_format=json I get an error from
jsonify or something stating that the value is not jsonifiable (does
that word exist?;).
So instead I return
dict(form=DataGird(field=fields).render(value=value). In the template
I just use XML(form) to display the form if the controller is called
without tg_format=json.
I would rather detect in the controller though whether or not it is
called with tg_format=json so I can decide in the controller if it
should return the rendered or unrendered form.
Do I make any sense? I hope somebody can help. Thanks in advance.
Dolf.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---