Pardon, the traceback of option b was not correct, here is the right one

-----Messaggio originale-----
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Per conto di Coletti Massimo
Inviato: mercoledý 20 ottobre 2004 10.31
Oggetto: [Zope-dev] Referencing a python method from a product page template


I am defining a Zope product to create a new portlet, the portlet will display some 
contents retrieved from a python module.

Under the product dir I have a file, with a method returnQuery(); the 
method returns a dictionary.

In the at product level, there is an:

The portlet page template is stored under a skin directory, properly registered in CFM.

In the portlet text, I tried two syntaxes to call the method:


<span tal:define="modulo here/queryBFE;
                            quotazione modulo/returnQuery;">


<span tal:define="quotazione modules/Products/CorpQuotes/queryBFE/returnQuery">
The first one returns:

Exception Type
Exception Value

The second one returns:

Exception Type
Exception Value
    You are not allowed to access 'queryBFE' in this context

  Module Products.PageTemplates.TALES, line 220, in evaluate
   - URL: /Plone/FinnatHome_view
   - Line 14, Column 10
   - Expression: standard:'modules/Products/CorpQuotes/queryBFE/returnQuery'
   - Names:
      {'container': <PloneSite instance at 0170EF50>,
       'context': <Document at /Plone/index.html>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x010BF5F8>,
       'here': <Document at /Plone/index.html>,
       'loop': <SafeMapping instance at 025DEC30>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance 
at 0x010AED00>,
       'nothing': None,
       'options': {'args': ()},
       'repeat': <SafeMapping instance at 025DEC30>,
       'request': <HTTPRequest, URL=http://localhost:8082/index.html/FinnatHome_view>,
       'root': <Application instance at 017C29E0>,
       'template': <ZopePageTemplate at /Plone/FinnatHome_view used for 
       'traverse_subpath': [],
       'user': coletti}
  Module Products.PageTemplates.Expressions, line 201, in __call__
  Module Products.PageTemplates.Expressions, line 189, in _eval
  Module Products.PageTemplates.Expressions, line 145, in _eval
   - __traceback_info__: modules
  Module Products.PageTemplates.Expressions, line 340, in restrictedTraverse
   - __traceback_info__: {'path': ['Products', 'CorpQuotes', 'queryBFE', 
'returnQuery'], 'TraversalRequestNameStack': ['returnQuery']}
Unauthorized: You are not allowed to access 'queryBFE' in this context

This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to