On Wednesday, July 8, 2015 at 8:53:40 AM UTC-4, [email protected] wrote: > > hello. I understand that i can cache the values. But my question is where > do i put that cache.ram statement. Do I put it in a model? but then that > cache statement is executed every request. >
You can put the cache statement wherever you will need access to the values stored in the cache. If you don't want to execute it on every request, you can put it in a controller or you could add a conditional statement to the model that executes the call only when needed. > What i would like to cache is group ids for the memberships. I would like > to lookup a role out of the auth_group table and store the id. > Do you want to store the roles of the current logged in user, or just the auth_group id's of particular roles? If the former, those are already stored in auth.user_groups. Anthony -- 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.

