thanks... the error is in import gluon.globals :

from gluon.globals import Response
response = Response() # import error

now:

from gluon import current
response = current.response

class View(object):
       def __init__(self, path):
            ........
        def __call__(self, fn):
            def _call():
                 response.view = self.path
                ......
                 ...... etc....

now work....


2013/8/22 Niphlod <[email protected]>

> BTW, I'm a fan of functional.
>
> from gluon import current
> def outer(view):
>     def wrap(f):
>         def wrapped_f():
>             current.response.view = view
>             return f()
>         return wrapped_f
>     return wrap
>
> @outer('path/to/view')
> def index():
>       return locals()
>
>
> On Thursday, August 22, 2013 9:20:44 PM UTC+2, Niphlod wrote:
>>
>> uhm. I'm totally ok for decorators that save lots of typing.
>> What's so different between
>> @View('whatever')
>> and
>> response.view = 'whatever'
>> ?
>>
>>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/ljp1IcabuSE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to