2010-05-19 2 views
3

ZMI의 개체에 추가 할 수 있도록 마커 인터페이스를 등록하고 싶습니다. 내 제품의 configure.zcml에는 다음이 포함마커 인터페이스를 등록하여 Plones의 ZMI에 표시되도록하려면 어떻게해야합니까?

<interface interface=".interfaces.IMarkerInterface" /> 

하고, 다시 설치 한 후, 인터페이스는 사용 가능한 인터페이스 목록에 표시됩니다. 그러나 ZMI의 객체에 추가하려고하면 ComponentLookupError이됩니다. 누락 된 것이 무엇입니까?

+0

오류에 대한 전체 추적을 포함 할 수 있습니까? –

+0

문제의 인터페이스를 제공하는 가짜 을 추가했는데 현재 작동하는 것처럼 보입니다. 그러나 이유는 모르겠습니다. – joeforker

답변

4

그것은 나를 위해 잘 작동했습니다.

from zope.interface import Interface 

class IBogusInterface(Interface): 
    """ Marker bogus interface 
    """ 

그리고이 configure.zcml이 interfaces.py 파일로

paster create -t plone bogus.interface

:

나는 paster와 패키지를 만든 플론 (Plone) 4.0.3

에서 테스트 파일 :

<configure 
    xmlns="http://namespaces.zope.org/zope" 
    xmlns:five="http://namespaces.zope.org/five" 
    xmlns:i18n="http://namespaces.zope.org/i18n" 
    i18n_domain="bogus.interface"> 

    <five:registerPackage package="." initialize=".initialize" /> 

    <!-- -*- extra stuff goes here -*- --> 
    <interface interface=".interfaces.IBogusInterface" /> 

</configure> 

아무것도 놓치지 않았습니까?

3

마커 인터페이스는 비어 있어야합니다. 속성이나 메소드를 포함 할 수 없습니다. 그렇게 할 경우 ZMI에 표시되지 않습니다.

관련 문제