我有一个自定义的内容类型。我需要的是一个匿名用户时,覆盖基本鉴于此对象只:覆盖自定义内容类型的方法index_html
class Imagesblock(folder.ATFolder):
.......
def index_html(self):
""" use the parent view """
portal_state = getMultiAdapter((self, self.REQUEST), name="plone_portal_state")
if portal_state.anonymous()==True:
response = self.REQUEST.response
url = self.aq_parent.absolute_url()
return response.redirect(url, status=303)
else:
return super(Imagesblock).index_html()
我应该使用超类的index_html,但我得到了一个错误:
AttributeError: 'super' object has no attribute 'index_html'
任何建议? 维托
超(Imagesblock,'self').index_html()? – Mathias