[ZPT] Re: URL quoting in ZPT

Evan Simpson evan@4-am.com
Tue, 03 Sep 2002 12:23:36 -0500


Jim Fulton wrote:
 > Evan Simpson wrote:
 >> Rather than binding 'tools' directly to this package, would it make
 >>  sense to bind it to a singleton object in the package?  This could
 >>  allow us finer-grained access control.
 >
 > How so?

Modules can only declare private/public, not use permissions.  Not that 
I know of any great clamor for permission-controlled tools, but I 
thought I'd raise the idea.

Jeffrey P Shell wrote:
 > Why not just stick with ZTUtils?
[...]
 > If we want 'tools' or something like it to be always available as a
 > quick shortcut, I fear that introducing it is the beginning of a
 > death march back to the cryptic shortcut hell of HTML.

It's a shortcut, but one that I think many ZPT users would appreciate. 
Writing "python:tools.Batch" rather than 
"python:modules['ZTUtils'].Batch" or always defining "tools 
modules/ZTUtils" yourself is nice if these tools are going to be used a lot.

As for the naming gripe: yes, ZFoo is generally a lame naming scheme. 
ZTUtils already suffers from this, and if we roll 'standard' into it, it 
will no longer be only a set of 'Template' tools.  In fact, I suspect 
that the Batch and Tree classes are already more likely to be used in a 
Script than directly in a ZPT.  Is 'ZTools' for "Zope Tools" really so bad?

Cheers,

Evan