[Zope] Using the set object within page templates

Dieter Maurer dieter at handshake.de
Tue Sep 27 13:37:56 EDT 2005


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


More information about the Zope mailing list