[z3-five] BrowserView and AttributeError on getPhysicalPath

Tim Hicks tim at sitefusion.co.uk
Wed Jul 12 21:05:18 CEST 2006


Tim Hicks wrote:
> Hi,
> 
> I have a view.py module that looks like:
> 
>    # Five imports
>    from Products.Five import BrowserView
>    from Products.Five.browser.pagetemplatefile \
>        import ZopeTwoPageTemplateFile as PageTemplateFile
> 
> 
>    class TopicView(BrowserView):
>        """
>        """
> 
>        topic_listing  = PageTemplateFile('./topic_listing.pt')
>        author_listing = PageTemplateFile('./author_listing.pt')
>        topic_view     = PageTemplateFile('./topic_view.pt')
> 
> 
> I have a ZCML snippet that looks like:
> 
>    <browser:page
>        for=".interfaces.IWeblog"
>        class=".browser.view.TopicView"
>        attribute="topic_listing"
>        permission="zope2.View"
>        name="topics" />
> 
> 
> When I visit a URL like .../[my_IWeblog_instance]/topics/ I get:
> 
>    Traceback (innermost last):
>      Module ZPublisher.Publish, line 107, in publish
>      Module Zope2.App.startup, line 227, in recordMetaData
>      Module OFS.SimpleItem, line 380, in getPhysicalPath
>    AttributeError: getPhysicalPath
> 
> 
> I'm trying to use the PageTemplateFiles with the Plone UI/macros.
> 
> Does anyone have any idea why this isn't working?

I should have said, I see this on Zope 2.8.4 with Five 1.2.5 and Zope 
2.9.3 (so whatever Five that is).

Also, I did *not* see this issue when I just directly declared the 
template in ZCML a la:

    <browser:page
       for=".interfaces.IWeblog"
       template="browser/topic_lists.pt"
       permission="zope2.View"
       name="topics" />

I guess this means that SimpleViewClass somehow behaves differently to 
my BrowserView-based class, but I can't figure out where SimpleViewClass 
comes from, or what it looks like, so I'm having trouble following that 
line of enquiry.


Tim

Tim


More information about the z3-five mailing list