[Zope] how to set anonymous access to authorized content?

Dieter Maurer dieter at handshake.de
Sun Jan 11 02:50:14 EST 2009


Jaroslav Lukesh wrote at 2009-1-9 19:06 +0100:
> ...
>But what to do with ZSQL methods? I was create Python script called 
>ZSQL_query:
>
>## Script (Python) "ZSQL_query"
> ...
>##parameters=my_string
> ....
>result=context.folder_few_levels_above.ZSQL_query(my_string=my_string)
>return len(result)
>
>
>
>But I was receive error:
>
>Error Type: TypeError
>Error Value: ZSQL_query() takes exactly 1 argument (0 given)
>.....
>  File /var/zope/lib/python/DocumentTemplate/DT_Let.py, line 75, in render
>    (Object: LET_druh_prace="ZSQL_query()")
>  File /var/zope/lib/python/DocumentTemplate/DT_Util.py, line 159, in eval
>    (Object: ZSQL_query())
>    (Info: ZSQL_query)
>  File <string>, line 2, in f
>  File /var/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in 
>__call__
>    (Object: ZSQL_query)
>  File /var/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in 
>_bindAndExec
>    (Object: ZSQL_query)
>  File /var/zope/lib/python/Products/PythonScripts/PythonScript.py, line 
>302, in _exec
>    (Object: ZSQL_query)
>    (Info: ({'script': <PythonScript instance at 9570fc0>, 'context': 
><Folder instance at 969a378>, 'container': <Folder instance at 
>969a378>, 'traverse_subpath': []}, (), {}, None))
>TypeError: (see above)

Apparently, the problem occurs when your Python Script "ZSQL_query"
(not the ZSQL method) is called.
Apparently, the Python Script is called without parameters but
it requires a parameter "my_string".



-- 
Dieter


More information about the Zope mailing list