db.define_table('person',
Field('salutation', mycustomwidget='select2', label = T('Salutation'), requires=IS_IN_SET(GENDER), represent=lambda v, r: GENDER[v]),
Field('first_name', label = T('First Name')),
format = '%(last_name)s')
If you need to add custom attributes to fields, you can simply do this:
1 | db.table.field.extra = {} |
"extra" is not a keyword ; it's a custom attributes now attached to the field object. You can do it with tables too but they must be preceded by an underscore to avoid naming conflicts with fields:
1 | db.table._extra = {} |
db.person.salutation.mycustomwidget = 'select2'