[Zope] 'or' queries in ZCatalogs? (and a general design question)
Howard Jones
howie@thingy.com
Wed, 31 May 2000 17:57:58 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01BFCB29.C17B3C80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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] !=3D ''">
<dtml-in threads>
<dtml-in "Catalog(meta_type=3D'Today Page =
Item',threads=3D_['sequence-item'])">
<dtml-if sequence-first>
<h4>Threads</h4>
<ul>
</dtml-if>
<dtml-unless "Catalog.getobject(data_record_id_).id =3D=3D =
PARENTS[0].id">
<li><a href=3D"<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
------=_NextPart_000_0005_01BFCB29.C17B3C80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am currently working on a toy zope =
project for=20
myself, which is a historical database of sorts (it's an On The Day In =
History=20
type of thing - today.thingy.com is the current version, which is =
somewhat=20
broken right now). What I wanted to do was be able to 'surf' events - =
have them=20
linked by the people involved, the timing of them, or some general =
theme, in a=20
similar way to wikiwebs (more like imdb really).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>So far, I have a TodayPageItem ZClass, =
with some=20
basic information (the body text, the date of the event) and a couple of =
'Lines'=20
type properties called People and Threads. In the index_html for =
presenting an=20
event object, I use:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><dtml-if "threads[0] !=3D =
''"><BR> =20
<dtml-in threads><BR> <dtml-in=20
"Catalog(meta_type=3D'Today Page=20
Item',threads=3D_['sequence-item'])"><BR>  =
; =20
<dtml-if=20
sequence-first><BR> &nb=
sp; =20
<h4>Threads</h4><BR>  =
; =20
<ul><BR> =20
</dtml-if><BR> =20
<dtml-unless "Catalog.getobject(data_record_id_).id =3D=3D=20
PARENTS[0].id"><BR> &nb=
sp; =20
<li><a href=3D"<dtml-var TodayBase><dtml-var=20
"Catalog.getpath(data_record_id_)">"><dtml-var=20
title></a><BR> =20
</dtml-unless><BR> =
<dtml-if=20
sequence-last><BR> &nbs=
p; =20
</ul><BR> =20
</dtml-if><BR> =20
</dtml-in><BR> </dtml-in=20
threads><BR></dtml-if></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>To show the related objects in the same =
threads as=20
this one (objects may involve more than one thread - Inventions, and =
Government,=20
for the found of the US Patent Office, for example).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>However, I then have a similar piece of =
DTML=20
directly below it to do the same for the People list.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Can I combine these? I would like to =
show one link=20
only for each related object, even if it related more than one way, and =
also to=20
show how they are related next to the link. According to the Advanced =
ZCatalog=20
howto, the only way of doing this loads the whole lot into memory - I =
plan to=20
have thousands of these! Is there some magic I'm missing?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance for any advice (don't =
do it this=20
way?),</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Howard</FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01BFCB29.C17B3C80--