[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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&lt;dtml-if "threads[0] != ''"&gt;<BR>&nbsp;&nbsp; 
&lt;dtml-in threads&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-in 
"Catalog(meta_type='Today Page 
Item',threads=_['sequence-item'])"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dtml-if 
sequence-first&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;h4&gt;Threads&lt;/h4&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;ul&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/dtml-if&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dtml-unless "Catalog.getobject(data_record_id_).id == 
PARENTS[0].id"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;li&gt;&lt;a href="&lt;dtml-var TodayBase&gt;&lt;dtml-var 
"Catalog.getpath(data_record_id_)"&gt;"&gt;&lt;dtml-var 
title&gt;&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/dtml-unless&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dtml-if 
sequence-last&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/ul&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/dtml-if&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/dtml-in&gt;<BR>&nbsp;&nbsp; &lt;/dtml-in 
threads&gt;<BR>&lt;/dtml-if&gt;</FONT></DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance for any advice (don't do it this 
way?),</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Best Regards,</FONT></DIV>
<DIV>&nbsp;</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