Felix Schwarz wrote: > Hi, > > Thomas Wittek filed ticket 1587 (http://trac.turbogears.org/ticket/1587). > > IMHO, there should be a possibility to disable the variabledecode on a > by-function basis. Obviously, this is not possible with the current > implementation of NestedVariablesFilter as a CherryPy before_main filter. The > latter causes problems with unit tests too if you use testutils.call. > > Therefore I already thought about moving the NestedVariablesFilter into the > expose function (did not investigated that one thoroughly though), making the > variable decoding a keyword parameter for expose (defaults to True in order to > preserve the current behavior). When the current filter is moved into a > decorator, the problem described by Thomas will be solved, too.
IMO, this behavior belongs in the "validate" decorator, not in expose which is already overcrowded. > Currently, I don't see any negative effects of doing this. > > Is the NestedVariablesFilter already implemented for TG 2? Does Pylons > integrate > this feature? IIRC, Pylons' validate decorator has a parameter to enable decoding. This is a feature worth copying for 1.x. To provide backwards compatibility decoding could be enabled by default. This can easily be disabled when decorating specific functions. > If not I think moving the functionality into a decorator would > ease the transition from CherryPy to Pylons. > > Comments welcome. I think it's a great idea. Go ahead :) Alberto --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
