[ZPT] Re: URL quoting in ZPT

Jeffrey P Shell jeffrey@cuemedia.com
Tue, 03 Sep 2002 11:41:08 -0600


On 9/3/02 11:23 AM, "Evan Simpson" <evan@4-am.com> wrote:

> 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.

Ack!  Did I say HTML?  I meant DTML. <dtml-with "_(mistake='mine')"> ;)

> 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.

We've been so good, thus far, by not allowing any (or many) exceptions to
the rules.  It's been a comforting thing to me.  I'd much much much rather
see decent documentation of the ZTUtils module (or whatever replaces it)
than a shortcut for typing it.  I still have a hard time getting trees under
control.  :\

> 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?

While the Tree and Batch classes are more likely to be used in scripts,
they're most likely being used in scripts to build things for use in Page
Templates.  I like distinguishing 'Template Tools' from catch-all 'Zope
Tools', because Zope Tools sounds like an awfully big bucket that just about
anything can be thrown into.  Then, you might have people trying to figure
out how to get their handy little functions and classes into this 'tools'
namespace rather than going through the already established 'modules',
object instances, or what-have-you.

-- 
Jeffrey P Shell 
www.cuemedia.com