If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    sophie  15 years ago
    This is using the SQLFORM. What can i do if i want to add this link through the controller? I am creating the table in the controller, i think i have to put the widget here, but i dont know how. My controlles is this: form=FORM(TABLE( TD("Caracteristica"), TD(SELECT(_name="caracteristica", *[OPTION(x.Caracteristica.nCaracteristica +' - '+ x.TipoCaracteristica.nTipoCaracteristica,_value=x.Caracteristica.id) for x in db((db.Caracteristica.idTipoCaracteristica==db.TipoCaracteristica.id)&\ (db.Caracteristica.id.belongs(lista))).select(orderby=db.Caracteristica.nCaracteristica)])), TD("Descripcion"),INPUT(_type='text',_name="descripcion"), INPUT(_type='submit',_value='Submit'))) if form.accepts(request.vars, session): if not form.vars.caracteristica=="": db.CaracteristicaCientifico.insert(nCaracteristicaCientifico=form.vars.descripcion, idCaracteristica=form.vars.caracteristica,idCientifico=session.idPrincipal) redirect(URL(r=request, c='cientifico', f='insert', args=["db","CaracteristicaCientifico"])) else: form.errors.caracteristica ='Seleccionar un registro'

Commented on:

This widget adds a link next to the