Why not to use session storage object?
It is available globally.
If you are using a dict such as --
{k1:v1, k2:v2},
you might consider using --
session.k1=v1, session.k2=v2
--Vineet
On Thursday, April 5, 2012 3:40:09 AM UTC+5:30, Richard wrote:
>
> Hello,
>
> I use to build dict in models, I do that mainly because I want those dict
> to be usable everywhere I want without thinking about them. Those dict are
> often id/fieldvalue that I use for custom representation where I can't rely
> on web2py built-in represent mechanism or translation purpose since I
> manage translation of field name in database for convenience... But I
> suspect that those dict creations are making my app slow even if I cache
> the query that I use to create them they most be re-generated each request.
>
> Is there a way I could create those dict once, having them global and at
> the same time as having them refresh (for those how are id/fieldvalue)?
>
> For id/fieldvalue, maybe I should just make query where required since
> they need by nature to be up to date.
>
> Thanks
>
> Richard
>