Re: [web2py] Form field defaults the second time through

2017-01-20 Thread Áureo Dias Neto
Change if form.process().accepted: form.vars.PostDate = request.vars.PostDate response.flash = T("Thank you!") to if form.process(keepvalues = True).accepted: response.flash = T("Thank you!") 2017-01-20 4:02 GMT-02:00 Armando Hernandez < armando.hernandez.ma...@g

[web2py] Form field defaults the second time through

2017-01-19 Thread Armando Hernandez
Assuming PostDate is a field of type datetime Try this before calling SQLFORM db.QuarterMaster.PostDate.default = request.now If PostDate is a field of type date use db.QuarterMaster.PostDate.default = request.now.date() and remove all the form.vars.PostDate assignments -- Resources: - http:

[web2py] Form field defaults the second time through

2017-01-19 Thread Dave S
I have a straight-forward controller function for entering the primary data: def index(): """ """ response.flash = T("Hello World") form = SQLFORM(db.QuarterMaster) form.vars.PostDate = str(request.now.year) + "-" + str(request.now.month ) + "-" + str(request.now.day) if f