[Zope3-Users] Data organization?
garrett at mojave-corp.com
Sat Mar 19 07:13:03 EST 2005
I would create an index for your Page objects.
Here's the gist:
- Create an interface for your index
- Create an implementation
- Configure the implementation as a local utility in ZCML
- Add your index utility to ++etc++site/default as providing the
Use event subcribers to update the index whenever the applicable Page
data changes. E.g.
index = zapi.getUtility(IYourIndex)
Use the index to quickly access all your pages whenever you need to.
for key in index:
page = index[key]
From: Leif K-Brooks
Sent: Fri 3/18/2005 1:25 PM
To: zope3-users at zope.org
Subject: [Zope3-Users] Data organization?
In my application, I have a type of object -- for simplicity's sake,
let's call it Book -- which can contain Page objects. Certain
operations will need to be done on all Page objects in the system (not
just the ones in a particular Book). If Books just contain Pages using
the ordinary container interface, all Book objects would have to be
scanned to find their Pages, which is a cumbersome arrangement I would
like to avoid if possible. What's the right way to do what I want?
Thanks in advance,
Zope3-users mailing list
Zope3-users at zope.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 3073 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20050319/e3da25ee/attachment.bin
More information about the Zope3-users