Linked table and represent

36 views
Skip to first unread message

LC LC

unread,
Jul 23, 2017, 8:36:07 AM7/23/17
to web2py-users
Hi,

Below you can find my code and my question

my db:
db.define_table('voyageur',
Field('Nom'),
Field('Prenom'),
Field('Usuel'),
..
Field('Scolarisation'),
Field('Dpt')
)

db.define_table(
'presence',
Field('Nom_id',db.voyageur,writable=False),
Field('present_le',type='date'),
Field('terrain',requires = IS_IN_DB(db, 'terrain.lieu', '%(lieu)s',zero=T('choose one')))
)

controller:
def index():
form = SQLFORM.smartgrid(db.voyageur)
records = SQLFORM.smartgrid(db.voyageur,linked_tables=['voyageur','presence'],user_signature=True,maxtextlength=100,deletable=True,\
editable=True,create=True,showbuttontext=False, paginate=200, buttons_placement = 'left',links_placement = 'left')

When i click on "presence" i 'd like to see Non (from voyageur table) instead of Nom_id, how can i do with represent i think
thanks in advance , regards

LC LC

unread,
Jul 23, 2017, 4:07:36 PM7/23/17
to web2py-users
Forget it stupid question . Jus need to use representation .
Sorry
Reply all
Reply to author
Forward
0 new messages