[Zope] Proposal: Include tino's patched <dtml-in> in future Z ope

Tino Wildenhain tino@wildenhain.de
Tue, 27 Feb 2001 14:40:06 +0100


Hi again :)

--On Dienstag, 27. Februar 2001 11:39 +0000 Toby Dickenson 
<tdickenson@geminidataloggers.com> wrote:

>> If you know while writing the code what attributes you want -
>> why schould
>> you
>> choose a prefix that interferes with your names? Why should
>> you choose a
>> specific prefix at all if you dont put loops into another?
>> Note it still
>> remains
>> "sequence" until specified.
>
> Because maybe someone else chooses the names of the properties, and does
> so after youve finalized your logic (whether it be dtml, or PythonScript).

So the routine does not work at all. Obviously. If someone changes anything
you rely on, it does not work. No matter if there is a renamed item or not.

> Maybe you want to make your logic robust even if that other user is
> malicious (or just really accident prone)

There is no gain in robustness if you consider not using the additional
prefix feature of my replacement :)

>> What if one chooses "sequence-item" just for the sake of example? ;)
>
> Damn. I was sure it didnt allow hyphens in property names.
>
> IMO the *real* answer is to not implement logic in dtml. The problems (and
> the need for this patch) go away.

The in-tag is not so much for logic but for implementing code generation
of part of the page with html in it.
There are requirements for this. I personally dont like python code 
cluttered
with HTML tags.

So the in-tag is handy to generate tables and such from database queries and
stuff like that. Ideally one would hide all logic in a method which returns
a list for the in-tag.

You can however do anything you want with python-scipt and external methods.

But dont let other people be punished with ugly constructs and many 
dtml-let's
to get some simple things done ;)

Regards
Tino