[web2py] Re: Retrieve value of dictionary in field with requires=IS_IN_SET(dictcionary)

2016-01-25 Thread Fabio Ceccarani
Il giorno sabato 23 gennaio 2016 20:01:37 UTC+1, DenesL ha scritto: > > web2py will only store the key part (1,2,.. or 5) in the category field. > You have to provide the value part for the key:value pairs. > > courses = {1:'Arte',2:'Artigianato',3:'Cucina',4:'sport',5:'informatica'} > >

[web2py] Re: Retrieve value of dictionary in field with requires=IS_IN_SET(dictcionary)

2016-01-23 Thread 'DenesL' via web2py-users
web2py will only store the key part (1,2,.. or 5) in the category field. You have to provide the value part for the key:value pairs. courses = {1:'Arte',2:'Artigianato',3:'Cucina',4:'sport',5:'informatica'} db.courses.category.requires = IS_IN_SET(courses, zero='Scegli la categoria' ) # it can