[web2py] Re: Can not check True/False on this field?

2013-03-08 Thread weheh
Cliff is absolutely right! If all you're storing is True or False, make the field a boolean. It's much more efficient in all respects. The list: string and list: reference are most useful if you're storing a reasonably small number of one to many relationships. -- --- You received this messa

[web2py] Re: Can not check True/False on this field?

2013-03-08 Thread Cliff Kachinske
Field('is_correct', 'boolean', default=False) In the form you get a checkbox widget unless you choose otherwise. In the controller: if form.vars.is_correct: # do something else: #do otherwise Less typing. Also, look in your database back end and see how it represents the values. You will find

[web2py] Re: Can not check True/False on this field?

2013-03-08 Thread Mika Sjöman
Huge thanks! That worked! Den fredagen den 8:e mars 2013 kl. 12:45:34 UTC+8 skrev weheh: > > What kind of error message are you getting? > > I assume the request.vars['lesson'] and request.vars.answer are both > indices into their respective tables. However, request.vars will be holding > these

[web2py] Re: Can not check True/False on this field?

2013-03-07 Thread weheh
What kind of error message are you getting? I assume the request.vars['lesson'] and request.vars.answer are both indices into their respective tables. However, request.vars will be holding these values as strings. Without knowing more, I would suggest putting an int() around those two vars, as