i realize my own mistake :
def purchase_return_form():
fields = ['purchase_order_no', 'notes']
form = SQLFORM(db.purchase_return_header, fields = fields)
if form.validate():
session.purchase_return_header = dict(form.vars)
redirect(URL('purchase_return_checkout') )
return dict(form = form)

def purchase_return_checkout():
if not session.purchase_return_header:
redirect(URL('purchase_return_form') )
rows = db(db.purchase_order_detail.purchase_order_no == 
session.purchase_return_header['purchase_order_no']).select()
session.purchase_return_detail = rows.as_list()
return dict(session_purchase_return_header = 
session.purchase_return_header, 
session_purchase_return_detail = session.purchase_return_detail)

should be :
def purchase_return_form():
fields = ['purchase_order_no', 'notes']
form = SQLFORM(db.purchase_return_header, fields = fields)
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()
redirect(URL('purchase_return_checkout') )
return dict(form = form)

def purchase_return_checkout():
if not session.purchase_return_header:
redirect(URL('purchase_return_form') )
return dict(session_purchase_return_header = 
session.purchase_return_header, 
session_purchase_return_detail = session.purchase_return_detail)

the session is always refresh back when i refresh the page, so i must put 
it on the previous page (assigned to the session right after the query 
passed). and for the inserted value, must refer to the session value itself 
not from query anymore.

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to