Simon Belak wrote:
> I see. From the top of my head you can:
>
> 1) Forsake error handlers and depending on tg_errors make the call
> "manually".
>
> 2) Use a proxy error handler:
>
>    def proxy(self, tg_errors, *args, *kw):
>        kw["add"] = True
>        kw["tg_errors"] = tg_errors
>        self.clients(*args, **kw)
>
>    @turbogears.expose()
>    ...
>    @turbogears.error_handler(proxy)
>    def save(self, cliente_id, **kword):
>       # (...)
>
> 3) Do something nasty with nested functions.
>
> Unfortunately neither of these solutions is elegant. Personally I would
> go with 2).
>

Just wondering, could something like this make sense or even work?

@error_handler(clients, add=True)

that calls client with add=True, what I mean is giving the method name
and then a list of parameters that you can pass to it (using kw).
This could work without the proxy thing.

This is probably totally wrong, just wondering what do you think Simon.

Thanks again for the great work.

Ciao
Michele

Reply via email to