Re: [Zope] Using the set object within page templates

2005-09-27 Thread Dieter Maurer
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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Using the set object within page templates

2005-09-27 Thread Chris Withers

Andreas Jung wrote:



Is there no way to allow sets to be used within templates/scripts?


As I said: No, by default.
Look at lib/python/Products/PythonScripts/README.txt.


Andreas means "yes", but you need to do some work. See 
lib/python/Products/PythonScripts/standard for examples ;-)


cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Using the set object within page templates

2005-09-26 Thread Andreas Jung



--On 26. September 2005 13:52:16 -0500 Floyd May <[EMAIL PROTECTED]> 
wrote:



Is there no way to allow sets to be used within templates/scripts?



As I said: No, by default.
Look at lib/python/Products/PythonScripts/README.txt.

-aj

pgpj6IBRvuIhK.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Using the set object within page templates

2005-09-26 Thread Floyd May
Is there no way to allow sets to be used within templates/scripts?

fm

>>> Andreas Jung <[EMAIL PROTECTED]> 9/26/2005 1:41:18 PM >>>
Python sets are not available from with ZPT since ZPT and
PythonScripts
run within a sandbox. Write an external method or move your code to
trusted code (Zope product).

-aj

--On 26. September 2005 13:38:55 -0500 Floyd May
<[EMAIL PROTECTED]>
wrote:

> 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.
>
> Thanks!
>
> fm
> ___
> Zope maillist  -  Zope@zope.org 
> http://mail.zope.org/mailman/listinfo/zope 
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce 
>  http://mail.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Using the set object within page templates

2005-09-26 Thread Andreas Jung

Python sets are not available from with ZPT since ZPT and PythonScripts
run within a sandbox. Write an external method or move your code to
trusted code (Zope product).

-aj

--On 26. September 2005 13:38:55 -0500 Floyd May <[EMAIL PROTECTED]> 
wrote:



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.

Thanks!

fm
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )






pgphoc0s3dS1Z.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Using the set object within page templates

2005-09-26 Thread Floyd May
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.

Thanks!

fm
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )