[web2py] Re: Update form fields on submit

2017-10-16 Thread backseat
Thanks, Bernhard. The solution I ended up with is quite messy, but it does work: # Set defaults if request.get_vars: filter_bar.vars.from_date = datetime.datetime.strptime( request.get_vars.from_date, "%Y-%m-%d").date() filter_bar.vars.to_date =

[web2py] Re: Update form fields on submit

2017-10-15 Thread Bernhard Radermacher
Might not be the most efficient, but if you put the from date and to date as arguments and then redirect in the form.accepts: if form.accepts(request,session): #calculate the new dates... session.flash='Updated date range' redirect(URL('report',args=[from_date,to_date])) --