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
>
#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()
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
>
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
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
5 matches
Mail list logo