I am currently working on a toy zope project for
myself, which is a historical database of sorts (it's an On The Day In History
type of thing - today.thingy.com is the current version, which is somewhat
broken right now). What I wanted to do was be able to 'surf' events - have them
linked by the people involved, the timing of them, or some general theme, in a
similar way to wikiwebs (more like imdb really).
So far, I have a TodayPageItem ZClass, with some
basic information (the body text, the date of the event) and a couple of 'Lines'
type properties called People and Threads. In the index_html for presenting an
event object, I use:
<dtml-if "threads[0] != ''">
<dtml-in threads> <dtml-in "Catalog(meta_type='Today Page Item',threads=_['sequence-item'])"> <dtml-if sequence-first> <h4>Threads</h4> <ul> </dtml-if> <dtml-unless "Catalog.getobject(data_record_id_).id == PARENTS[0].id"> <li><a href="<dtml-var TodayBase><dtml-var "Catalog.getpath(data_record_id_)">"><dtml-var title></a> </dtml-unless> <dtml-if sequence-last> </ul> </dtml-if> </dtml-in> </dtml-in threads> </dtml-if> To show the related objects in the same threads as
this one (objects may involve more than one thread - Inventions, and Government,
for the found of the US Patent Office, for example).
However, I then have a similar piece of DTML
directly below it to do the same for the People list.
Can I combine these? I would like to show one link
only for each related object, even if it related more than one way, and also to
show how they are related next to the link. According to the Advanced ZCatalog
howto, the only way of doing this loads the whole lot into memory - I plan to
have thousands of these! Is there some magic I'm missing?
Thanks in advance for any advice (don't do it this
way?),
Best Regards,
Howard
|