Using Plone 3.3.5 I'm trying to get the absolute url for an object from a
brain; however, even though that brain exists, I get the traceback below. I'd
appreciate any help understanding this error.
Here's the relevant code:
def taglist(self):
for tag in self.data.tags.split('\n'):
tag = tag.strip()
if tag:
brain = self.tag_index_brain
if brain:
url = brain.getURL()
yield {
'tag': tag,
'url': "%s?%s" % (url,
urlencode({"tag": tag})),
}
else:
yield {
'tag': tag,
'url': '',
}
Here's the traceback:
2010-05-15 21:56:18 ERROR portlets Error while rendering
<plone.app.portlets.manager.ColumnPortletManagerRenderer object at 0x81df1f0>
Traceback (most recent call last):
File
"/Users/michael/Plone/buildout-cache/eggs/plone.app.portlets-1.2.1-py2.4.egg/plone/app/portlets/manager.py",
line 65, in safe_render
return portlet_renderer.render()
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/Shared/DC/Scripts/Bindings.py",
line 313, in __call__
return self._bindAndExec(args, kw, None)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/Shared/DC/Scripts/Bindings.py",
line 350, in _bindAndExec
return self._exec(bound_data, args, kw)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/Products/PageTemplates/PageTemplateFile.py",
line 129, in _exec
return self.pt_render(extra_context=bound_names)
File
"/Users/michael/Plone/buildout-cache/eggs/Products.CacheSetup-1.2.1-py2.4.egg/Products/CacheSetup/patch_cmf.py",
line 126, in PT_pt_render
tal=not source, strictinsert=0)()
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/zope/tal/talinterpreter.py",
line 271, in __call__
self.interpret(self.program)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/zope/tal/talinterpreter.py",
line 346, in interpret
handlers[opcode](self, args)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/zope/tal/talinterpreter.py",
line 822, in do_loop_tal
iterator = self.engine.setRepeat(name, expr)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/zope/tales/tales.py",
line 685, in setRepeat
it = self._engine.iteratorFactory(name, expr, self)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/zope/tales/tales.py",
line 110, in __init__
self._next = i.next()
File "/Users/michael/dev/cms/naz.umbrella/naz/umbrella/portlets/tags.py",
line 78, in taglist
url = self.tag_index_brain.getURL()
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/Products/ZCatalog/CatalogBrains.py",
line 44, in getURL
return self.REQUEST.physicalPathToURL(self.getPath(), relative)
File
"/Users/michael/Plone/Zope-2.10.11-final-py2.4/lib/python/Products/ZCatalog/CatalogBrains.py",
line 33, in getPath
return self.aq_parent.getpath(self.data_record_id_)
AttributeError: getpath
2010-05-15 21:56:18 ERROR Zope.SiteErrorLog 1273974978.090.403702010434
http://localhost:8080/Plone/shim/main_nav_bkg.png
Traceback (innermost last):
Module plone.app.portlets.manager, line 65, in safe_render
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
Module Products.CacheSetup.patch_cmf, line 126, in PT_pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 822, in do_loop_tal
Module zope.tales.tales, line 685, in setRepeat
Module zope.tales.tales, line 110, in __init__
Module naz.umbrella.portlets.tags, line 78, in taglist
Module Products.ZCatalog.CatalogBrains, line 44, in getURL
Module Products.ZCatalog.CatalogBrains, line 33, in getPath
AttributeError: getpath
Best wishes,
Michael A. Smith
Web & Digital / Academic Technologies Manager
Nazareth College
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers