[Zope] some Zope issues: dtml-zpt, permissions, scalability

Paul Winkler pw_lists at slinkp.com
Thu Nov 20 09:50:46 EST 2003


On Thu, Nov 20, 2003 at 08:53:09AM +0100, Andre Meyer wrote:
> Dear Zopers
> 
> During the last few weeks I have been working through the documentation of Zope for building my own products. One valuable source was the Zope Bible. With help from this list and the authors of the book I decided to go for a file system based product using ZPT. Unfortunately, the example in the book is using DTML like most others still do. When trying to convert from DTML to ZPT I found the following problem:
> It is easy to change dtml-in to tal:repeat and the like. But how to convert from dtml-call to tal? Look at the folowing snippet:
> 
> --------------------------------------------------------------------------------
> 
> <dtml-unless SelectedGroup>
>  <dtml-call "REQUEST.set('SelectedGroup', 'All')">
> </dtml-unless>

As Dragos said, you don't need REQUEST.set() to achieve this, just use tal:define
in the appropriate enclosing tag.

But in general, if you need to call something without displaying the results,
there is no equivalent to dtml-call so we just use tal:define with a
dummy name, like so:

<span tal:define="dummy python:some_method(arg=foo)"> </span>

> Another problem occurs with permissions. The following snippet works in dtml, but when converted to zpt (accessing here/listEntriesByGroup) the same method cannot be accessed any longer.
> 
> --------------------------------------------------------------------------------
> 
> <dtml-in "listEntriesByGroup(_['SelectedGroup'])" size=20 start=start sort_expr="sort_by">
>   <tr <dtml-if sequence-even>bgcolor="#CCCCCC"</dtml-if>>
>    <td><input type=checkbox name="EntryIDs:list" value="&dtml-id;"></td>
>    <td><a href="&dtml-id;"><dtml-var title></td>
>    <td><dtml-var Title>&nbsp;</td>
>    <td><dtml-var Company>&nbsp;</td>
>    <td><a href="<dtml-var id>/editEntryForm">Edit</a></td>
>   </tr>
> </dtml-in>
> 
> --------------------------------------------------------------------------------

That seems unlikely. Can you post your ZPT version, and the actual error it
gives you?

> Yet another issue is related to scalability when I have an object that references a list of other objects using a dictionary. How does this perform when the dictionary contains 10.000 or 50.000 entries? Is that feasible or are there better solutions?

Dictionaries are quite fast and scale pretty well.
50,000 is not too many.
But there might be performance issues, depending on how & how often this dictionary
is generated; whether it is stored as part of a persistent object; and what its
values are (paths? object references? what?); and how many of them you have.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's CAKE MEGA!
(random hero from isometric.spaceninja.com)



More information about the Zope mailing list