[Zope-CMF] index_html acquisition
Wed, 14 May 2003 00:10:56 -0500
No, this isn't strange at all. The line of code that says
probably is never executed since your class doesn't have an index_html
attribute. It inherits one from PortalContent. Chris wanted you to set
the index_html attribute to Acquisition.Acquiried:
from Products.CMFCore.PortalContent import PortalContent
""" a class """
index_html = Acquision.Acquired
""" do something """
I suppose instead you could add this line to your __init__():
Hope that helps.
David Hart wrote:
> Chris Withers wrote:
>> David Hart wrote:
>>> I've discovered PortalContent is setting index_html = None.
>>> Is there any way this variable can be 'unset' to re-enable
>>> acquisition of index_html?
>> in your class do:
>> index_html = Acquisition.Acquired
>> ...make sure you import the Acquisition module somewhere too ;-)
> Thanks for the tip! This sure looks like it should work, but it doesn't
> (when in __init__)
> Last week, I had this in __init__:
> def __init__( self, id, title='', description='' ):
> if hasattr(self, 'index_html'):
> Which worked fine. Upon coming back to testing this week, a page render
> throws this error:
> Module Products.AtlantisBlueProduct.TestObject, line 105, in __init__
> KeyError: index_html (Also, an error occurred while attempting to render
> the standard error message.)
> Isn't that strange??