[Zope-dev] DTML Syntax contd. + rant + summary
Stuart 'Zen' Bishop
zen@cs.rmit.edu.au
Sat, 13 Nov 1999 09:25:33 +1100 (EST)
On Fri, 12 Nov 1999, David Jacobs wrote:
> I always thought it would be nice to have a python subroutines page
> associated with a DTML page. It would be limited in capability like
> PythonMethods and would be scoped to the page. Since this would greatly
> simplify the addition of small Python subroutines, it would ease the demand
> on DTML to perform so much logic processing and allow it to focus on
> presentation.
I like this - the problem I see with seperating layout and programming
is that the programmers will just lump all their layout in the program
code. In this way they just have to maintain one page rather than
a DTML page and 'n' PythonMethods/External Methods.
Hmm.... If I could take the following code:
def hello(): print "Hello"
def world(): print "World!"
Could I add it to the current namespace (using existing DTML paradigm)?
<dtml-let common=myMethods>
<dtml-comment>Or dtml-width if you prefer</dtml-comment>
<dtml-var common.hello>
<dtml-var common.world>
</dtml-let>
ie. a 'library' object will return a map of callable objects.
This would probably have to be seperate to a 'code' object which would
be executed and stdout being its rendered version.
___
// Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au
// E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au
//__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen