[Zope] get url for localfs objects

Michael Bleijerveld michael at bleijerveld.nl
Thu Aug 14 16:10:16 EDT 2003


Hi,

I am using the following statements for displaying links to Localfs objects.

<tr tal:repeat="files batch" >
      <td><input type="checkbox" name="ids:list" value="<dtml-var id>"></td>
      <td><a href="HOME_URL" tal:attributes="href python:getLink(id)"
tal:content="files/id">HOME TITLE OR ID</a></td>
     <br>
</tr>

However when I use the python script getLink I receive the following error.
What's wrong ?

Traceback (innermost last):
  a.. Module ZPublisher.Publish, line 98, in publish
  b.. Module ZPublisher.mapply, line 88, in mapply
  c.. Module ZPublisher.Publish, line 39, in call_object
  d.. Module Shared.DC.Scripts.Bindings, line 252, in __call__
  e.. Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
  f.. Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec
  g.. Module Products.PageTemplates.PageTemplate, line 95, in pt_render
  <ZopePageTemplate at /Smartstorage/test3>
  h.. Module TAL.TALInterpreter, line 200, in __call__
  i.. Module TAL.TALInterpreter, line 244, in interpret
  j.. Module TAL.TALInterpreter, line 636, in do_loop_tal
  k.. Module TAL.TALInterpreter, line 244, in interpret
  l.. Module TAL.TALInterpreter, line 295, in do_startTag
  m.. Module TAL.TALInterpreter, line 363, in attrAction_tal
  n.. Module Products.PageTemplates.TALES, line 223, in evaluateText
  o.. Module Products.PageTemplates.TALES, line 217, in evaluate
  URL: /Smartstorage/test3
  Line 18, Column 10
  Expression: <PythonExpr getLink(id)>
  Names:
{'container': <Folder instance at 017F7D68>,
 'default': <Products.PageTemplates.TALES.Default instance at 0141AC54>,
 'here': <Folder instance at 017F7D68>,
 'loop': <SafeMapping instance at 018F2B18>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 0141A84C>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 018F2B18>,
 'request': <HTTPRequest, URL=http://10.0.0.151:8080/Smartstorage/test3>,
 'root': <Application instance at 017EF6E8>,
 'template': <ZopePageTemplate at /Smartstorage/test3>,
 'traverse_subpath': [],
 'user': admin}p.. Module Products.PageTemplates.ZRPythonExpr, line 48, in
__call__
  __traceback_info__: getLink(id)
  q.. Module Python expression "getLink(id)", line 2, in f
NameError: global name 'getLink' is not defined.

Regards.

Michael





More information about the Zope mailing list