This is a little different then this topic but still related to models. I want to find a way where we can load web2py in a consistent process on startup that doesn't stop when there is no activity. And also on startup I can choose which code I want to load once and remain in memory. That way on each request it doesn't reload the models for example it just uses the code already in memory. Like singletons where there is only every one instance in memory that all actions use.
A better explanation: In youadworld we have a binary tree that is large, instead of loading it with every request to an action I'd rather have it loaded in memory, and only save to the database after the in memory version is updated. That way each new request only loads the logic that will act on the data models already in memory. I suppose my thinking is different because I come from a game programming back ground where everything is in real-time and loaded into memory on startup, then there is just message requests sent to the server to return the fresh data in real-time. On Mon, Mar 12, 2012 at 4:24 PM, Anthony <abasta...@gmail.com> wrote: > I don't know Python all that well but I suspect the better approach would >> be putting models in classes and then importing them in controllers as >> needed... models in modules...seem like hacky workarounds to me. >> > > But "putting models in classes and then importing them in controllers" > _is_ "models in modules" (or at least one way of implementing models in > modules). > > -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com