[Zope] Writing a file in ZMI using python script (fwd)

Andreas Jung lists at zopyx.com
Tue Jun 10 07:44:07 EDT 2008


Please stay on the list.

There are enough ways for caching: RAMCache, HTTP Cache, external
caches like Squid/Apache. I consider your approach partly broken.

Andreas

------------ Forwarded Message ------------
Date: 10. Juni 2008 16:40:54 +0530
From: Kedar Dash <kedar.dash at oneworld.net>
To: Andreas Jung <lists at zopyx.com>
Subject: Re: [Zope] Writing a file in ZMI using python script

Andreas Jung wrote:
>
>
> --On 10. Juni 2008 16:28:14 +0530 Kedar Dash <kedar.dash at oneworld.net>
> wrote:
>
>> HI All,
>>
>> How can i create a file in ZMI using python script (It is working fine
>> with python external method). Here I want to write the output of a query
>> to a file in ZMI.
>>
>> from Products.PythonScripts.standard import html_quote, structured_text
>> from Products.CMFCore.utils import getToolByName
>> portal_catalog = getToolByName(context, 'portal_catalog')
>>
>> request = container.REQUEST
>> RESPONSE =  request.RESPONSE
>> site_title = context.portal_url.getPortalObject().Title()
>> site_desc = context.portal_url.getPortalObject().Description()
>> site_url = context.portal_url.getPortalObject().absolute_url()
>>
>> query = {}
>> query["portal_type"]='Article'
>> query["sort_on"]='Date'
>> query["sort_order"]='reverse'
>> query["review_state"]='published'
>> query['getMycategory']=my_id #our search category
>>
>> brains = portal_catalog.searchResults(**query)
>>
>> I want to write the output to file and access in ZMI.
>>
>>
>
> What's the sense of saving the result? Write a temple calling your
> script and render the result based on the current state of your catalog.
>
> Andreas
Thanks Andreas,

I do not want query every time and rather want to put it in a file.
Apparently this script will be called from around 100 site and will lead to
extra load on zope.

Thanks for your response.

regards,
Kedar

---------- End Forwarded Message ----------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20080610/18a189ac/attachment.bin


More information about the Zope mailing list