I have a set
mp_list=gdb(gdb.municipality.province==gdb.province.id)
which I'm trying to use it in a select field but causes an error:
Field('municipality',requires=IS_IN_DB(mp_list,'municipality.psgc_m',
'%(municipality.name)s
(%(province.name)s)'))
I'm trying to get it to show in the dropdown like this: municipal_name
(province_name). How do I format the field names from a set?
I tried and can generate a query of the rows I'd like to have :
mp_list=gdb(gdb.municipality.province==gdb.province.id)\
.select(gdb.municipality.psgc_m,gdb.municipality.name,\
gdb.province.name,orderby=gdb.municipality.name)
for x in mp_list: print x['municipality']['name']+' ('+x['province']['name']+')'