Web app scope question
fee
fee at fee.com
Thu Sep 9 11:51:12 EDT 2004
More information about the Python-list mailing list
Thu Sep 9 11:51:12 EDT 2004
- Previous message (by thread): limiting symbols in C module
- Next message (by thread): running web script with the permissions of the authenticated system user
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm using mod_python to write a web app. I always load one file, index.py which generates the skeleton of the page, while functions and objects from other modules are used to produce the content based on the current state of the app. Some of the data, such as a registrants id number, shopping cart data, current app page/state etc... are needed by almost every module that provides content for the page. In my old PHP app, these were simply global vars, which aside from its reputation as bad form worked fairly well. Now, I find myself stuffing all of these things into an object, and passing it around every where, as an argument to each function, or as a constructor argument. The other alternative that I have considered is to make a 'borg' class, whose attributes always remain the same across instantiations. I just wondered about the experience of the list regarding sets of data that really need to be visible to most of the modules in the app. Thanks, Toby
- Previous message (by thread): limiting symbols in C module
- Next message (by thread): running web script with the permissions of the authenticated system user
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list