[Zope] put python script in other directory.

Jianping Zhu jzhu at fisher.forestry.uga.edu
Thu Dec 4 18:16:38 EST 2003


Diretory stucture is 
root
  --subdir1
     --ssubdir1
     --ssubdir2
  --dev
     --mydev

  
I need to search some Zobject in subdir1 from diretory  mydev.

following python scirpt works if i put it in sundir1
[code]
    from Products.PythonScripts.standard import html_quote
    request = container.REQUEST
    RESPONSE =  request.RESPONSE

    catalog =container

    if not type:
        type = ['Units', 'UnitHeadquarter', 'SupervisoryUnit']

    query = {}
    query['TemplateType'] = type

    if Unit:
        query['id'] = Unit

    query['sort_on'] = 'Title'
    results = catalog.searchResults(query)

    return results
[/code]	
The problem is that i have not right to put scirpt in subdir1
i one can put script in dev->mydev


[code]
    from Products.PythonScripts.standard import html_quote
    request = root.subdir1.REQUEST
    RESPONSE =  request.RESPONSE
    catalog =root.subdir1

    if not type:
    type = ['Units', 'UnitHeadquarter','SupervisoryUnit']

    query = {}
    query['TemplateType'] = type

    if Units
       query['id'] = Unit

    query['sort_on'] ='Title'
    results =catalog.searchResults(query)

    return results
[/code]
But this way does not work, how can i change the script so i can put in
in mydev and be able to search Zobjects in subdir1?

Thanks




More information about the Zope mailing list