[prev in list] [next in list] [prev in thread] [next in thread]
List: zope
Subject: [Zope] 'or' queries in ZCatalogs? (and a general design question)
From: "Howard Jones" <howie () thingy ! com>
Date: 2000-05-31 16:57:58
[Download RAW message or body]
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
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>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).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><dtml-if "threads[0] != ''"><BR>
<dtml-in threads><BR> <dtml-in
"Catalog(meta_type='Today Page
Item',threads=_['sequence-item'])"><BR>
<dtml-if
sequence-first><BR>
<h4>Threads</h4><BR>
<ul><BR>
</dtml-if><BR>
<dtml-unless "Catalog.getobject(data_record_id_).id ==
PARENTS[0].id"><BR>
<li><a href="<dtml-var TodayBase><dtml-var
"Catalog.getpath(data_record_id_)">"><dtml-var
title></a><BR>
</dtml-unless><BR>
<dtml-if
sequence-last><BR>
</ul><BR>
</dtml-if><BR>
</dtml-in><BR> </dtml-in
threads><BR></dtml-if></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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).</FONT></DIV>
<DIV><FONT face=Arial size=2>However, I then have a similar piece of DTML
directly below it to do the same for the People list.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance for any advice (don't do it this
way?),</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Best Regards,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Howard</FONT></DIV></BODY></HTML>
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic