hi,

i store rows query in the session, and want to remove it, is it need two 
step for that?
e.g.
def purchase_return_form():
    form = SQLFORM(db.purchase_return_header)
    if form.validate():
        session.purchase_return_header = dict(form.vars)
        rows = db(db.purchase_order_detail.purchase_order_no == 
session.purchase_return_header['purchase_order_no']).select()
        *session.purchase_return_detail = rows.as_list() # store session as 
list()*
    return dict(form = form)
    
def empty_return_0(session_return_header, session_return_detail, 
redirect_cart):
    session_return_header.clear()
    # step one delete all except i = 1
    for i, row in enumerate(session_return_detail):
        del session_return_detail[i]
    # step two delete i = 1
    for i in xrange(0, len(session_return_detail) ):
        del session_return_detail[i]
    redirect(URL(redirect_cart) )

the problem is if i just use one all value that store in session detail is 
not deleted all, always remain i=1, so that i must take two steps for that.
is it the correct way to handle it in web2py?

thanks and best regards,
stifan

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to