[Zope] Optimisation fun and games
Hannu Krosing
hannu@tm.ee
20 May 2002 13:40:23 +0200
On Mon, 2002-05-20 at 12:35, Stefan H. Holek wrote:
> --On Montag, 20. Mai 2002 11:09 +0200 Hannu Krosing <hannu@tm.ee> wrote:
>
> > <dtml-in> is also a thing to avoid if possible - in a test portal front
> > page implementation I rewrote 3 instances of
> >
> >
> > <dtml-in "subfolder.objectValues()">
> > <tr>
> > <td>
> > <a href="sisu/<dtml-var id>"><dtml-var title_or_id></a>
> > <dtml-if is_admin><dtml-var "muuda_link(id)"></dtml-if>
> > </td>
> > </tr>
> > </dtml-in>
> >
>
> Your problem is objectValues *not* dtml-in. The way you do it, all listed
> objects are actually accessed, which means loaded into memory and such.
> *Always* use ZCatalogs for listings like the above!
But I _do_ need them all. How else can I display their id ?
> 7. Use catalogs whenever possible. It is even reasonable to catalog results
> from external sources like RDBMS (ZSQLMethods).
Thanks. I'll look at it.
-----------
Hannu