Well, the code checks two conditions, correct and not correct, and only one of 
those is true on any given request. Yet you only set the value of one of your 
session variables within each condition -- so of course the one you don't set 
is None (it is actually undefined, but the session object is a Storage object, 
which returns None for any requested attribute that doesn't exist). Outside of 
the conditional logic, you could do something like:

session.counter = 0 if session.counter is None else session.counter

Alternatively, you could move that to the view:

{{=0 if session.counter is None else session.counter)}}

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to