[web2py] Re: truly global/single instance variable

2014-07-26 Thread Anthony
Rather than have your module code read a text file, you might also consider putting the data directly into the module itself (unless you need the text file to keep the data in a format more friendly to human editing): MY_LIST = [ ['item 1', 'item 2', 'etc.'], ... ] Anthony On Saturday,

Re: [web2py] Re: truly global/single instance variable

2014-07-26 Thread Jonathan Lundell
On 26 Jul 2014, at 7:13 AM, lucas wrote: > i have it in a module and under that module i have the variable setup as a > global variable. wherein, if the variable is empty upon using it, i load the > list of lists from a text file. if it is not empty, then i just use it. so > in that case, is

[web2py] Re: truly global/single instance variable

2014-07-26 Thread lucas
i have it in a module and under that module i have the variable setup as a global variable. wherein, if the variable is empty upon using it, i load the list of lists from a text file. if it is not empty, then i just use it. so in that case, is there just the single instance in memory, no mat

[web2py] Re: truly global/single instance variable

2014-07-26 Thread Anthony
Maybe put it in a module and import it. On Saturday, July 26, 2014 2:59:55 AM UTC-4, lucas wrote: > > hello one and all, > > i need a little advice. i have a rather large table that i use to lookup > hard unchangeable values. essentially is a big list of smaller lists. > > i know that each user

[web2py] Re: truly global/single instance variable

2014-07-26 Thread Leonel Câmara
An easy way would be to store it in cache.ram. However, I would have to profile this to see if you have much of a performance gain versus simply defining the list in your models. It would definitely save memory but memory isn't the only concern. -- Resources: - http://web2py.com - http://web2p