On Oct10, 10:28am, Thadeus Burgess <thade...@thadeusb.com> wrote:
> Is there a way to cache two different versions of a function?
>
> Say you have a contact page, that when users are logged in, includes a
> comments and suggestions form, however when your not logged in, does not
> display this form.
>
> Is there a way to cache one version for logged in users, and the other
> version for everyone else? The html never changes except for the display of
> the form.
>
> -Thadeus


Perhaps you can use:

@cache( '%s_%s' % ( request.env.path_info, auth.is_logged_in() ), ...)
def foo():
  # your stuff

However I doubt a cached form would ever get processed when it is self-
submit (to the same url). Did not try that before. Please post your
test result.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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