On 3/17/06, Elvelind Grandin <[EMAIL PROTECTED]> wrote:
> well. how about this
>
> @expose("stringTemplate:.welcome", as_format="text")
> @expose(".templates.xml", accept_format="xml/foo")
> @expose("json")
> @expose(".templates.welcome")
> def ..
I figured out what the problem is in the above scenario, but I haven't
got a good solution.
The default for as_format is "default". The above tries to set both
json and .templates.welcome as the "default" choice. expose("json",
as_format="json") does the trick. as_format="default" needs to be
there, because otherwise standard-looking single expose cases won't
get set as the default.
expose("json", as_format="json") is not a good substitute for allow_json.
also, in controllers.py a check was being made for allow_json !=
False. allow_json was actually coming in as None (which != False), so
I'm not sure that json is turned off in the current release.
I need to sleep now, but I'm committing something with a failing test
and better logging.
Kevin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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-trunk
-~----------~----~----~----~------~----~------~--~---