Ri:Re: [Zope] Z-SQL Method performance

Jens Vagelpohl jens@zope.com
Thu, 4 Apr 2002 10:56:14 -0500


what do you mean by "internal python script"? if it is a python script in 
the ZODB then i think it will still trigger the security mechanism.

jens

On Thursday, April 4, 2002, at 10:15 , Stefano Vedovelli wrote:

> Hello Jens
>> one exception where the security machinery will not check are simply 
>> python
>> types (the return values from a ZSQL method are objects that contain the
>> results and not simple types), such as strings, lists, dictionaries etc.
>>  so
>> if you use an external method to get the result set and then convert it
>> inside the external method to such a simple type and hand that back to 
>> DTML
>> you will see a marked increase in speed.
>
> consider this:
> recordset = context.retrieve_all_contacts().dictionaries()
> for record in recordset:
>    for key in record.keys():
>       print key, "=", record[key]
>
> from my how-to http://www.zope.org/Members/spinwing/ZSQL_Results.
>
> In this case, is Zope applying security as well? This is an internal 
> python script.
>
> This is interesting for me so that I can include it in the how-to.
>
> Regards
> Stefano
>
>