我正在与viewlets
. 我的想法是用我自己的徽标、菜单、地址栏等内容覆盖默认的克隆站点。viewlet
我在自己的createPictMenu.py
文件中使用了默认代码。里面的代码brundelre3/eggs/plone.app.layout-2.3.4-py2.7.egg/plone/app/layout/viewlets/common.py ->class LogoViewlet(ViewletBase):
我的 createPictMenu.py 看起来像这样
class bdrMenuView(LogoViewlet):
template = ViewPageTemplateFile('templates/main_page.pt')
def __init__(self, context, request, view, manager=None):
super(ViewletBase, self).__init__(context, request)
self.__parent__ = view
self.context = context
self.request = request
self.view = view
self.manager = manager
def main_page(self):
return self.template()
这里 LogoViewlet 是我从鸡蛋文件夹下的 common.py 继承的类。它成功地用我的菜单替换了 plone.logo。我在下面看到了localhost:8086/brundelre3/@@manage-viewlets
但是当我运行我的项目时,localhost:8086/brundelre3/main_page.html
它显示错误
错误信息 :
2013-08-14 11:18:19 ERROR Zope.SiteErrorLog 1376459299.050.254417887359 http://localhost:8086
/brundelre3/main_page.html
Traceback (innermost last):
Module ZPublisher.Publish, line 115, in publish
Module ZPublisher.BaseRequest, line 501, in traverse
Module ZPublisher.BaseRequest, line 346, in traverseName
Module ZPublisher.BaseRequest, line 116, in publishTraverse
Module zope.component._api, line 120, in queryMultiAdapter
Module zope.component.registry, line 238, in queryMultiAdapter
Module zope.interface.adapter, line 532, in queryMultiAdapter
TypeError: __init__() takes at least 4 arguments (3 given)
谁能告诉这段代码有什么问题?