cache the mail and only access it if its no longer cached?

Or have a table that stores all sent mailings

sent_mail
  -> bedrijf
  -> message

You still query the database, but you have to store the info somewhere
at some point in time if it is to be accessed later.

-Thadeus





On Sat, Mar 20, 2010 at 6:06 AM, annet <annet.verm...@gmail.com> wrote:
> I have another question:
>
> In case the user would like to view the html mail in his browser, I
> have got the following line of code:
>
> <td class="browser" align="left">
>    {{if not request.function=='browser_version':}}
>   <p>Having trouble viewing this email? <a
> href="{{=URL(r=request,c='clublocatormail',f='browser_version',args=[nfa.bedrijf])}}">View
> it in your browser</a></p>
>    {{pass}}
> </td>
>
>
> I would like to use the same view, however, that view contains the
> variable nfa.bedrijf, which, in case of the mail, is available from
> the context. The link to the browser_version function contains
> args=[nfa.bedrijf], so nfa.bedrijf is available as request.args[0] in
> the browser_version function, but I don't now to pass it on to the
> view in a suitable way.
>
> I could do:
>
> def browser_version():
>    response.view='send_mail.html'
>
> nfa=db((db.nfa.nfatype==4)&(db.nfa.bedrijf==request.args[0])).select(db.nfa.ALL)
>    return dict(nfa=nfa)
>
> ..., but that would unnecessarily query the database. Is there another
> way to solve this problem?
>
>
> Kind regards,
>
> Annet.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to