must be a typo in the cookbook, should be
return dict(message=T('Hello Stranger'), counter=session.counter)
On May 21, 11:54 pm, NikG <[email protected]> wrote:
> Hello everyone. I'm learning web2py on my own by following the
> cookbook and the "cut" book examples.
>
> Using web2py version 1.62.3 and following the session counter example,
> I get an error but I have no idea what's wrong:
>
> Traceback (most recent call last):
> File "/home/vin/web2py/gluon/restricted.py", line 107, in restricted
> exec ccode in environment
> File "/home/vin/web2py/applications/myapp/compiled/
> controllers_default_index.py", line 62, in <module>
> File "/home/vin/web2py/gluon/globals.py", line 80, in <lambda>
> self._caller = lambda f: f()
> File "/home/vin/web2py/applications/myapp/compiled/
> controllers_default_index.py", line 19, in index
> TypeError: __call__() got an unexpected keyword argument 'counter'
>
> my default.py:
> def index():
> """
> example action using the internationalizaiton operator T and flash
> rendered by views/default/index.html or views/generic.html
> """
> session.counter=session.counter+1 if session.counter else 1
>
> response.flash = T('Welcome to web2py')
> return dict(message=T('Hello Stranger', counter=session.counter))
>
> .... <snip>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---