Thanks for helping me solve this one. In the end I did the following:
1) hacked DocumentTemplate/DT_Util.py to include "filter" in the __builtins__
2) Installed PythonMethods and called pruneTree with parameter 'self' and content
return _.filter(
lambda x:
- Original Message -
From: "Lalo Martins" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 29, 2000 11:40 PM
Subject: Re: [Zope] Use of lambda expression in DTML
On Mon, May 29, 2000 at 10:58:54PM -0400, Chris McDonough wrote:
dtml-in "_.m
In brief: I get a NameError when invoking "filter(...)" from DTML. I thought this
was a built-in python method, so I'm a bit puzzled.
Python's ideas of 'built-in' is simply any method in the module
stored in the global variable called __builtins__. Any code executed
with a non-standard
Chris McDonough wrote
Nope. Lamba, filter, reduce, and map should IMHO not be part of DTML.
Actually, exprs probably shouldn't be in there in the first place.
People are trying to use DTML as a way to process non-UI elements. This
is a slippery slope, and leads to something like PHP or
On Tue, May 30, 2000 at 10:28:42PM +0200, you wrote:
Minor note:
"lambda" is not a builtin but part of the syntax (a keyword).
I am sure, they will work in expressions.
Uh. Of course that is correct.
[]s,
|alo
Nick Drew wrote:
|I can see that argument... it depends on the reader, I suppose. I
|wouldn't complain much actually if the Python code had functional stuff
|in it. It's having it in DTML that bugs me, for reasons that
|have to do
|with separating HTML-like stuff from the stuff that
On Fri, May 26, 2000 at 03:05:14PM -0700, Jonothan Farr wrote:
In brief: I get a NameError when invoking "filter(...)" from DTML. I thought
this was a built-in python method, so I'm a bit puzzled.
Certain built-ins are not available in dtml for security and other reasons,
filter and
On Mon, May 29, 2000 at 09:40:59PM +0200, Martijn Pieters wrote:
I can't comment with authority on why these methods are not accessible, but I
imagine that they are banned because they'll probably let you lock up Zope in
one way or another, creating a convenient denial-of-service attack.
If
What I would like to say is that if your application needs lambda, filter or
map, your code is getting bejond report or presentation generation (for which
DTML is intended) and in the realm of data manipulation and business rules. In
this case your code would be much better placed in some
Nick Drew writes:
I'm a newbie zopista, and python for that matter...
In brief: I get a NameError when invoking "filter(...)" from DTML. I thought this
was a built-in python method, so I'm a bit puzzled.
For security reasons, Zope are removed all builtin-functions from
DTML
10 matches
Mail list logo