Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Eliezer (Vlad) Tseytkin
this is simply awesome! thank you ! On Thu, Jun 20, 2019 at 2:07 PM Val K wrote: > #pretty decorator > def with_email_to(addr): > def inner(f): > def emailer(): > ret = f() > html = response.render(ret) > ... # send html to addr by email >

Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Val K
#pretty decorator def with_email_to(addr): def inner(f): def emailer(): ret = f() html = response.render(ret) ... # send html to addr by email return html return emailer return inner @with_email_to('j...@google.com') def foo()

Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Eliezer (Vlad) Tseytkin
oops got it! changing it right now! simple and brilliant, as always :) On Thu, Jun 20, 2019 at 1:39 PM Val K wrote: > I mean the following logic: > def foo(): > ... > ret = dict(...) > if email_required: > html = response.render(ret) > ... # send html by email >

[web2py] Re: emailing the content of the current page

2019-06-20 Thread Val K
I mean the following logic: def foo(): ... ret = dict(...) if email_required: html = response.render(ret) ... # send html by email return html return ret On Thursday, June 20, 2019 at 8:26:33 PM UTC+3, Vlad wrote: > > I couldn't figure out how this wok

[web2py] Re: emailing the content of the current page

2019-06-20 Thread Vlad
I couldn't figure out how this woks, so just rendered it again. Not a big deal - just a matter of convenience. The email requests come occasionally, so this extra render doesn't cause trouble. Thank you, Val! On Thursday, June 20, 2019 at 6:23:55 AM UTC-4, Val K wrote: > > I think you can try