On Saturday, September 19, 2015 at 4:18:49 AM UTC-4, Yebach wrote: > > Hello > > So I managed to put link and create it but now I have a probelm getting > the id of the record I want to deal with > > links = [lambda row: A('',_class='glyphicon glyphicon > glyphicon-remove-sign', > callback=URL('settings','deactivate',vars=dict(table='skills',field = > 'sk_status', value = form.vars.id )))] >
If you want the id of the record in a given row of the table, then instead of value=form.vars.id, it should be value=row.id. > @auth.requires_login() def deactivate(): ##Aktiviramo delavca ko user > klikne na activate user = auth.user_id org = db(db.auth_user.id == > user).select(db.auth_user.organization)[0]["organization"] #Worker je id > zaposlenenga ki ga damo v aktiven id = request.vars["id"] > In the URLs generated in the grid, you used the variable name "value", yet here you are looking for the variable name "id". The above line should be: id = request.vars.value Or you can change the URLs to use "id" as the variable name. Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.