[Zope3-Users] Fields are not inherited
Florian Lindner
mailinglists at xgm.de
Mon Sep 12 13:30:44 EDT 2005
Hello,
I have a interface:
class IContentItem(Interface):
"""The ContentItem object works as a base class for all other content
objects."""
def __setitem__(name, object):
"""Add a IContentItem object."""
title = TextLine(
title = u"Name",
description = u"Name that will be part of the URL",
required = True)
description = TextLine (
title = u"Description",
description = u"Description of the object.",
required = False)
This interface should not represent a content item, it should just work as a
common base for all other content objects.
It does not have a class which implements it.
I've registered it with:
<interface interface=".interfaces.IContentItem" />
I've also tried adding type="zope.app.content.interfaces.IContentType".
When I look at the apidoc of this Interface no attributes/fields are shown.
Another interface is derived from that one:
class ILink(IContentItem):
"""This interface stores information about a URL."""
def __setitem__(name, object):
"""Adds a ILink object."""
URL = URI (
title = u"URL",
description = u"The URL.",
required = True)
In the apidoc of this interface only the URL field is shown. None of the
inherited fields.
This content object is registered as usual:
<configure xmlns="http://namespaces.zope.org/zope">
<interface interface=".interfaces.ILink"
type="zope.app.content.interfaces.IContentType" />
<content class=".link.Link">
<implements
interface="zope.app.annotation.interfaces.IAttributeAnnotatable" />
<factory />
<require permission="zope.Public" interface=".interfaces.ILink" />
<require permission="zope.Public" set_schema=".interfaces.ILink" />
</content>
</configure>
Why are the fields of ContentItem not inherited?
Thanks,
Florian
More information about the Zope3-users
mailing list