[Zope3-dev] Inline code

Shane Hathaway shane at zope.com
Tue Feb 10 14:04:05 EST 2004


On Tue, 10 Feb 2004, Gary Poster wrote:

> Do I understand correctly that in this scheme effectively each template 
> page would have its own local module?

Yes.

However, I just came up with another issue.  Imagine if someone wrote the 
following:

<script type="text/server-python">
def getstuff():
    return '%s' % context.stuff
</script>

That script discreetly references the name "context".  If the name
"context" is available, the script can't be moved painlessly to another
module.  OTOH, if the name "context" is not available, the template has
two global namespaces: one for ZPT and one for Python code.  That's not
good.

Given the choices presented, here are my votes.

1. No inline code; rely on code in modules.  Also make it easy to write
modules TTW.

  +1

2. Allow inline code with print statements.  Also unify the TALES and
Python namespaces, making names like "context" available to inline code.  
(The status quo.)

  -1

3. Allow inline code, but no print statements.  Disassociate the TALES and
Python namespaces.  (Shane's suggestion.)

  +0

4. Drop ZPT and use scripts to do simple document transformation.  
(Casey's suggestion.  Similar to XMLC.)

  -0

Shane



More information about the Zope3-dev mailing list