I dont understand, I asked how I can access individual records in the grid?

On Friday, October 5, 2012 4:31:34 AM UTC+1, Massimo Di Pierro wrote:
>
> Using your code:
>
> def admin():
>     grid = SQLFORM.grid(db.auth_user, onupdate = messenger)
>     return locals()
>
> def messenger(form):
>     # use form.record or form.vars # <<<<<
>     mail.send(to="email", subject="welcome to icop", message="bla bla")
>
> On Thursday, 4 October 2012 22:16:17 UTC-5, Pystar wrote:
>>
>> Hi, 
>> I need some clarification on the grid, how do I access the contents on 
>> the grid and target a function at that record? I want to send a mail to 
>> every user whenever I update their records gotten from the 
>> SQLFORM.grid(db.auth_user). How do I do that? 
>>
>> On Friday, October 5, 2012 3:44:02 AM UTC+1, Massimo Di Pierro wrote:
>>>
>>>
>>> def messenger():
>>>     mail.send(to="email", subject="welcome to icop", message="bla bla")
>>>
>>> should be
>>>
>>> def messenger(form):
>>>     mail.send(to="email", subject="welcome to icop", message="bla bla")
>>>
>>> yet. This should raise a ticket.
>>>
>>> I tried and (with the change) it works for me. Try adding a print 
>>> statement. It is possible the code is executed but the email is not going 
>>> out for some reason.
>>>
>>> On Thursday, 4 October 2012 21:29:39 UTC-5, Pystar wrote:
>>>>
>>>> def admin():
>>>>     grid = SQLFORM.grid(db.auth_user, onupdate = messenger)
>>>>     return locals()
>>>>
>>>> def messenger():
>>>>     mail.send(to="email", subject="welcome to icop", message="bla bla")
>>>>
>>>> its not working as expected. i.e. on updating the records in the grid, 
>>>> no message is sent to the user. rather it says that messenger doesnt 
>>>> accept 
>>>> any arguments, but 1 was given. 
>>>> HELP.
>>>>
>>>> On Thursday, October 4, 2012 9:43:32 PM UTC+1, Niphlod wrote:
>>>>>
>>>>> at least post whatever code you're trying to run without success :P
>>>>>
>>>>> On Thursday, October 4, 2012 10:03:10 PM UTC+2, Pystar wrote:
>>>>>>
>>>>>> it didnt work. I need help
>>>>>>
>>>>>> On Thursday, October 4, 2012 8:29:51 PM UTC+1, Pystar wrote:
>>>>>>>
>>>>>>> From the book, I can see this SQLFORM.grid(onupdate, oncreate, 
>>>>>>> ondelete), I should believe that I can pass a function to the onupdate 
>>>>>>> argument that will call a function to send mails whenever a record is 
>>>>>>> updated. I believe this is correct without testing if it is now. Will 
>>>>>>> do so 
>>>>>>> and return with findings
>>>>>>>
>>>>>>> On Thursday, October 4, 2012 8:08:06 PM UTC+1, Pystar wrote:
>>>>>>>>
>>>>>>>> How do I customize SQLFORM.grid() to send a mail to users in a db 
>>>>>>>> whenever data is updated from the grid? tips, hints?
>>>>>>>>
>>>>>>>>

-- 



Reply via email to