Difficult to help without knowing what the error is. Do you have a 
traceback?

When you return a dict from a controller function, web2py looks for the 
associated view and then executes the view. If the view is expecting some 
variable to be in the returned dict but that variable happens not to be in 
locals() at the point you call return, then the view will generate an error.

Anthony

On Saturday, February 16, 2013 2:03:01 AM UTC-5, 黄祥 wrote:
>
> hi anthony,
>
> sorry, i'm not sure what do you mean 'the view is expecting a particular 
> variable to be returned but that variable is not in locals()'
>
> here is the code that return an error:
>
>     for k, v in session.order.items():
>         if v==0:
>             del session.order[k]
> *            redirect(URL('order')) # if use return locals() an error 
> will occur*
>
> the logic is : it just checked if somebody made an order value is 0 
> (zero), they won't get into the bill page. when i use redirect to the order 
> page, it's work fine, what i've expected, but when i try to learn to use 
> return locals() an error rise. 
>

-- 

--- 
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/groups/opt_out.


Reply via email to