[prev in list] [next in list] [prev in thread] [next in thread]
List: zope3-users
Subject: [Zope3-Users] Data organization?
From: garrett () mojave-corp ! com (Garrett Smith)
Date: 2005-03-19 7:03:49
Message-ID: FB37E9B9E9354A4788F1B322E4AAD1D881C6 () server1 ! mojave ! local
[Download RAW message or body]
Hi Leif,
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
interface
Use event subcribers to update the index whenever the applicable Page
data changes. E.g.
index = zapi.getUtility(IYourIndex)
index.addPage(...)
index.setPageFoobar(...)
Use the index to quickly access all your pages whenever you need to.
E.g.
for key in index:
page = index[key]
-- Garrett
-----Original Message-----
From: Leif K-Brooks
Sent: Fri 3/18/2005 1:25 PM
To: zope3-users@zope.org
Cc:
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,
Leif K-Brooks
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3073 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20050319/e3da25ee/attachment.bin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic