There are many ways to do. The simplest was it create a module in your
app

   applications/yourapp/modules/pickle_loader.py

that contains

   import cPickle
   data = cPickle.load(.....)

then in your model:

   pickle_loader = local_import('pickle_loader')
   data = pickle_loader.data



On Mar 3, 6:44 am, praveendasigi <[email protected]> wrote:
> Hi,
>
> I have a large pickle file (approx 400MB) which contains objects to be
> used by various controllers in my app. The pickle loading obviously
> cannot happen online whenever the application is accessed. Earlier
> when I built a primitive version of this app with cherrypy alone, the
> pickle loaded along with server startup. I am unable to understand how
> to do it in the web2py setup. The requirement is to load this data
> once into memory ( say, every time on server restart) and persist it
> indefinitely. Is there a straightforward way to do this?? The objects
> cannot exist in any other form like a DB etc., Any help is
> appreciated. Thanks.
>
> Praveen

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

Reply via email to