|
From: Kevin A. <al...@se...> - 2002-01-21 18:44:02
|
shelve is one option we have for creating persistant data. ZODB is another. We can't use something like anydbm, because the actual files created by anydbm aren't portable across operating systems, only the source is portable. Dan Shafer has started looking at shelve as described below. Those of you interested in this area should share your findings on the list. The shelve module is documented at: http://www.python.org/doc/current/lib/module-shelve.html There is an older tracker item for shelve as well: http://sourceforge.net/tracker/index.php?func=detail&aid=442150&group_id=190 15&atid=369015 ka --- Dan Shafer opened up a new tracker item on shelve: http://sourceforge.net/tracker/?func=detail&atid=369015&aid=506564&group_id= 19015 Summary: Looking at shelve I had a chat with Kevin over the last day or two about document models and decided to dive into the development effort in a semi-modest way by looking into persistent object stores for PythonCard. The shelve stuff looks very straight-forward and clean, so I'm going to take a first pass through a couple of quick tests with it. It is very transparent, fully cross-platform, and handles any arbitrary Python object. I'm not yet sure how this factors into or influences the document model. I think I can make this pretty transparent as long as we assume single-user stacks. The shelve we create can be given the same name as the stack/app transparently to the user. My first step will be to take the Addresses stack and switch it from a text file to a shelve for storage, just to get my arms around the beast and to show two different document models. Then I'll take one of my old HyperCard stacks that makes more extensive use of storage and give it a whirl. A shelve can be _opened_ for read access by multiple users but only the first one to open it gets write privileges (like FileMaker at least used to be), and there seems to be no way to control this (i.e., explicit role or privilege assignment). I think that's perfectly acceptable, though, don't you? Since I don't anticipate at this point that we'd even expose this to a user, who would simply get automatic data storage and retrieval a la HyperCard, I don't think we need to wrapper anything. Exploring it has been fun. Dan |