Hi!

We recently upgraded from 1.98.2 to 1.99.2, and seem to find a
regression. An SQLFORM renders boolean database fields as checkboxes.
If you (un)check a box and hit submit, calling myform.accepts() and
redisplaying the form used to render the fields with the new, updated
values. Since the upgrade the checkboxes show the old values, until
the page is refreshed explicitly.

It seems that the change in the behavior is caused by changing a
condition in INPUT._postprocessing(). There used to be a line:

if t == 'checkbox':

which is now:

if t == 'checkbox' and not '_checked' in self.attributes:

Since _postprocess() is called when the INPUT is constructed (which
immediately creates a '_checked' attribute), calling it again after
updating the database is ineffective.

I don't know why this change in the condition was necessary, but now
checkboxes (and radiobuttons) behave inconsistently, since all other
type of input fields show the updated values when redisplaying the
form (as expected). Would anyone take a look at this issue?

Reply via email to