Andy Dustman wrote:
OK, here's how I did it:

def variabledecode(func):
    def newfunc(self, *args, **kwargs):
        from formencode.variabledecode import variable_decode
        return func(self, *args, **(variable_decode(kwargs)))
    newfunc.func_name = func.func_name
    return newfunc

Note that formencode.variabledecode.NestedVariables is a validator version of the variabledecode algorithm, and so you should be able to pass it in as a schema argument to expose.

That said, I think variable_decode makes particular sense in a CherryPy context, as you can turn just about any kind of form into a sensible function signature using it, by naming your fields correctly. So if turbogears.expose applied it by default to every request, that might be most useful. Though potentially surprising to people as well.

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org

Reply via email to