I checked and it works for me (insert is correct) but retrieval is not correct because
db.define_table("aaa", db.Field("bbb"), migrate=False) should be db.define_table("aaa", db.Field("bbb","list:string"), migrate=False) You should be able to change this and data in db should be file. With "list:string" the '|xxx|yyy|zzz|' is in the db but web2py only sees ['xxx','yyy','zzz'] On Sep 20, 1:24 pm, Wikus van de Merwe <dupakrop...@googlemail.com> wrote: > I've noticed that recent versions of web2py (1.85) create a different > string in DB when form with checkboxes is serialised (compared to > version 1.77). > > db.define_table("aaa", db.Field("bbb"), migrate=False) > > db.aaa.bbb.widget = SQLFORM.widgets.checkboxes.widget > db.aaa.bbb.requires = [IS_IN_SET(BBB_VALUES, multiple=True), > IS_NOT_EMPTY()] > > Before what was stored in DB was a '|' separated list of checked > options: > |xxx|yyy|zzz| > Now, it is a serialisation of a python list: > ['xxx','yyy','zzz'] > > Obviously this breaks compatibility when I read the field from DB and > try to parse the options. > > Interestingly setting default options on form display works "the old > way": > form=SQLFORM(db.aaa) > form.vars.bbb = "|".join(BBB_VALUES)