Something like that :
next_week_sunday_date = \
(request.now.date() + datetime.timedelta(days=7)) +
datetime.timedelta(days=6 - request.now.weekday())
rows_with_records_of_software_license_that_will_end_the_next_sunday =
db(db.table_name.field_date_name == next_week_sunday_date
).select(db.table_name.ALL)
Then :
for r in
rows_with_records_of_software_license_that_will_end_the_next_sunday:
# get data you require from you table row and send you email
Richard
On Wed, Apr 11, 2018 at 4:01 AM, Prabhakar Shanmugam <[email protected]>
wrote:
> Dear All,
>
> I have just started learning web2py and I have hands on in python.
>
> Please just give some pointers. Iam sure this might be a trivial question,
> but I thought during the learning process I will ask this trivial question.
>
> I was seeing if i can write a license expiry daet management app, so that,
> we get a notification well before the license expires.
>
> I was going through the documentation, and I got some examples for sending
> emails, however, am not finding a way to identify a field value say a
> expiry date field and then calculating it and seeing if it is 40 or less
> days from today and notify.
>
> What are the options available to me to achieve this.
>
> Regards,
> Prabhakar
>
>
> --
> 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.
>
--
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.