Hello, i am newbie.

I wrote this code to check two tables and delete a register if ok, and is 
working ok:

In sqlform create a button:

lambda row: A(T('Delete'),_onclick='return confirm("Delete??")', 
_class="btn", _style="background:#F78181", _href=URL("delete_depto",args=[ 
"depto", row.id,row.name]))]

in function:

def delete_depto()
    arg1=request.args(0) #Filename
    arg2=request.args(1) #Index
    arg3=request.args(2) #Department Name
 
    row = db(db.other_table.name==arg3).select().first()
    if not row: 
        del db[arg1][arg2]
        #Send a message "Deleted" ??
    else:
        #Send a message "Not Deleted" ??
     
There's any way to send this message in the form?
response.flash not working to me.

Thanks.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to