alfonsodg / demo-web2py

Apache License 2.0
0 stars 0 forks source link

SQLFORM.factory does not include hidden fields in form.vars (SQLFORM does) #160

Closed alfonsodg closed 10 years ago

alfonsodg commented 10 years ago

From nathan...@gmail.com on January 20, 2011 09:43:22

What steps will reproduce the problem? A minimal example: likertRightAnswer = ['Yes', 'No', 'Impossible to tell']

form = SQLFORM.factory(
    Field('rightAnswer',
          widget=horizontal_radios, 
          requires=IS_IN_SET(likertRightAnswer,
                             error_message=T('Please choose a response.'))),
    hidden={'timestart':request.now.strftime('%Y-%m-%d %H:%M:%S')}
    )

In this case, BEAUTIFY(request.post_vars) will include, timestart and rightAnswer, but BEAUTIFY(form.vars) will only include rightAnswer.

If we instead setup the appropriate db as db.ratings, and then do: likertRightAnswer = ['Yes', 'No', 'Impossible to tell']

form = SQLFORM(db.ratings,
    hidden={'timestart':request.now.strftime('%Y-%m-%d %H:%M:%S')}
    )

In this case, both BEAUTIFY(request.post_vars) and BEAUTIFY(form.vars) will both include timestart and rightAnswer What version of the product are you using? On what operating system? According to the README in the /src directory, v.1.87.3 Please provide any additional information below.

Original issue: http://code.google.com/p/web2py/issues/detail?id=162

alfonsodg commented 10 years ago

From nathan...@gmail.com on January 20, 2011 08:17:13

Sorry, I forgot to specify my software stack.

Ubuntu 10.04 LTS
python 2.5
google_appengine.1.4.1/

and invoked with: python2.5 dev_appserver.py ../workspace/nathanvan-mcreatia/src

alfonsodg commented 10 years ago

From massimo....@gmail.com on July 21, 2011 08:20:56

I cannot reproduce this problem

Status: Invalid