[ZODB-Dev] Sample applications?
Patrick K. O'Brien
pobrien@orbtech.com
Mon, 8 Oct 2001 12:25:17 -0500
I started working on a sample application over the weekend, called
NoteKeeper. At this point I'm mostly just playing around with different
ideas about how to store object collections and associations. And I'm
creating various utilities to make it easier to work with ZODB files. If
you'd like to follow along or help out I'm making the files available on SF.
Right now the stuff is only available through CVS:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/orbtech/ZODBrowser/
I've also made some recent changes to the PyCrust shell to do a better job
showing call tips, auto-completion and namespace inspection of Zope and ZODB
extension classes. These changes are in the CVS version of PyCrust:
http://sourceforge.net/projects/pycrust/
The area I could really use help with is evaluating the various ways to
create branches off the database root. Here is the code where I'm trying
different options. (Sorry if it is a bit obtuse. The comments should explain
things.)
def initBranches(self):
"""Initialize branches."""
# Folder branch using FolderManager.
from ZODBrowser.folder import FolderManager as aBranch
self.folderManager = self.branch(aBranch.__name__, aBranch())
# Folder branch using PersistentMapping.
from ZODB.PersistentMapping import PersistentMapping as aBranch
self.loadBranch(aBranch)
# Folder branch using IOBTree.
from BTrees.IOBTree import IOBTree as aBranch
self.loadBranch(aBranch)
def loadBranch(self, aBranch):
"""Create a branch whose name is based on the aBranch class name."""
command = 'self.folder' + aBranch.__name__ + \
' = self.branch("Folder' + aBranch.__name__ + '",
aBranch())'
exec command
FolderManager is a class that has a property that is an IOBTree where new
folders are stored.
I don't want to make this message much longer, but I would like to hear from
anyone who has an opinion about how to structure root elements. Especially,
what to use as the key for Btrees, and why. (I have spent years doing
relational databases and am having a hard time going from
tables/views/queries to object collections.) Any help would be appreciated.
---
Patrick K. O'Brien
Orbtech (http://www.orbtech.com)
"I am, therefore I think."
-----Original Message-----
From: zodb-dev-admin@zope.org [mailto:zodb-dev-admin@zope.org]On Behalf Of
Patrick K. O'Brien
Sent: Thursday, October 04, 2001 5:49 PM
To: ZODB
Subject: [ZODB-Dev] Sample applications?
Does anyone have a sample application that uses ZODB, but not Zope? I'm
looking for something that goes a bit further than the examples included in
Michel Pelletier's articles. If I can't find one, I plan to create one.
Would anyone else be interested in such a thing?
One idea I had was to start with something extremely simple, like a note
organizer. There would simply be two types of objects: notes and folders. A
note would have a title and body, both strings. A folder would have a title
and could contain both notes and other folders, in a typical hierarchy. This
application should be relatively trivial, but useful enough to actually be
used by someone on their desktop. I would probably do the interface in
wxPython. Anyone care to help? Any other ideas for possible applications?
---
Patrick K. O'Brien
Orbtech (http://www.orbtech.com)
"I am, therefore I think."
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/
ZODB-Dev mailing list - ZODB-Dev@zope.org
http://lists.zope.org/mailman/listinfo/zodb-dev