Dont use for loop and in select(<put use condition here for time )

On Tuesday, 6 March 2012 17:59:04 UTC+5:30, Sanjeet Kumar wrote:
>
> i am able to send the mail through the cron job but when i am going to 
> send the mail by fetching the email id from the database i got confused in 
> the logic :-
>
> i have the followng code :
>
> list = []
> import datetime
> currentdate = datetime.datetime.now()
> for row in db(db.employee.time == currentdate).select():
>     list.append(row.empdetail)
> here is my send mail function it is sending only the last id i know the 
> for loop scope is ended that is the reason its happening but i am not be 
> able to get the proper solution to send the mail to the each of the id only 
> once with the all details when the date will be matched in the same table 
> more than one emp details are there so i want to send the mail to the 
> each individual employee at a time.
>
>

Reply via email to