[web2py] Re: on Crud accept

2011-10-13 Thread Anthony
You don't have to pass it -- crud will automatically pass the form as the first and only argument to your onaccept or onvalidation function. Anthony On Thursday, October 13, 2011 9:44:12 AM UTC-4, Web2Py Freak wrote: > > but how can i bass it then ? how the function know what to pass ?

[web2py] Re: on Crud accept

2011-10-13 Thread Web2Py Freak
but how can i bass it then ? how the function know what to pass ?

[web2py] Re: on Crud accept

2011-10-13 Thread Anthony
You have to do: def send_mail(form): The form will be passed as an argument to send_mail (same as if you use a lambda). Note, you don't have to name the argument 'form' -- call it whatever you want. Anthony On Thursday, October 13, 2011 9:32:35 AM UTC-4, Web2Py Freak wrote: > > thnx its worki

[web2py] Re: on Crud accept

2011-10-13 Thread Web2Py Freak
thnx its working now but i want to ask you somthing , how can i do it in a function : def send_mail(): mail.send('halna...@gardeniatelco.com','Contact Us form by : ' +form.vars.your_email,'Full Name :'+form.vars.your_name+' Email :'+form.vars.your_email+'Comment is :'+ form.vars.comment+' Band i

[web2py] Re: on Crud accept

2011-10-13 Thread Anthony
I think so. Give it a try. You can also write a separate function (e.g., send_mail), and then just do crud.create(..., onaccept=send_mail). On Thursday, October 13, 2011 9:04:24 AM UTC-4, Web2Py Freak wrote: > > can i do it like this : > > crud.create(...,onaccept=lambda > form:mail.send('haln.

[web2py] Re: on Crud accept

2011-10-13 Thread Web2Py Freak
can i do it like this : crud.create(...,onaccept=lambda form:mail.send('halna...@gardeniatelco.com','Contact Us form by : ' +form.vars.your_email,'Full Name :'+form.vars.your_name+' Email :'+form.vars.your_email+'Comment is :'+ form.vars.comment+' Band is:'+form.vars.your_band+'')) this is right

[web2py] Re: on Crud accept

2011-10-13 Thread Anthony
You can use crud.settings.create_onaccept (see http://web2py.com/book/default/chapter/07#Settings) or crud.create(..., onaccept=lambda form: your code) (see http://web2py.com/book/default/chapter/07#Methods). Anthony On Thursday, October 13, 2011 8:47:03 AM UTC-4, Web2Py Freak wrote: > > Dear