27 Sep
2005
27 Sep
'05
5:37 p.m.
Floyd May wrote at 2005-9-26 13:38 -0500:
How can I use a set object within a page template?
When I attempt to create a set (e.g. tal:define="myset python:set(some_list)"), zope complains that the name 'set' is not defined.
It is right, because "set" is not listed in "RestrictedPython.Guards.safe_builtins". These definitions together with "RestrictedPython.Utilities.utility_builtins" define the set of built in names for untrusted code. Almost surely, you will also need to "allow_type" the "set" -- in order to access the methods of set objects. You can access "allow_type" (in trusted code) from "AccessControl". -- Dieter