Re: Displaying Values Retrieved from Database
Rich Shepard <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 4 Dec 2006, [email protected] wrote: > Maybe I am naive, but I always think the simplest way is the best. Now > maybe I am not understanding your problem, but unless you need to > dynamically update fields based on someother input, is it not easier to > just query the database when the user goes to a tab, or opens a window? This does not seem to address the issue. I suppose that I could trap an 'enter tab' event and query the database to extract that subject's values, but what if the database structure changes? Then I need to find every instance of the old structure and change it to the new structure. Having this all in one place I believe is easier. And, ... I have the solution working now. It turns out that using wx.lib.pubsub() is much easier than it first appeared when I looked at the sparse API doc page and the wiki page. The library is imported in each module, the openDB() function publishes the message that a database has been opened, and each tab/class subscribes to that message topic. Then each tab can take the retrieved data and stuff them in the appropriate widgets for display. Rich -- Richard B. Shepard, Ph.D. | The Environmental Permitting Applied Ecosystem Services, Inc.(TM) | Accelerator <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863