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 )))]

how do i get sqlform grid record to send it to my function???

Anthony this is my function
I have to change field status in a table. We have more than one status
(active, pending, deleted archived) so I couldnt use the web2py default
funciton as true or false
since we name our filed status based on table i have to send table name and
table field that is why this kind of function because i use it in different
tables

@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"] table =
request.vars["table"] field = request.vars["field"] print request print id
query = db(db[table].id == id).update(**{field: 1}) return locals()

Thank you

2015-09-18 18:41 GMT+08:00 Anthony <abasta...@gmail.com>:

> Yes, but what problem do you observe? Are the URLs not getting generated
> properly? Is the value not available in request.get_vars? What happens when
> you click? Can you show the code of the action associated with that URL?
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/3T1Qaf39wJg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Lep pozdrav

Vid Ogris

-- 
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.

Reply via email to