I created a Dexterity content type and defined a simple schema:
....
....
class IMyType(model.Schema):
myField = schema.TextLine(
title=_(u"My Field:"),
)
....
....
Under Plone 4.3, Dexterity content types provide IContentType. However, under Plone 5.0.6 it seems that Dexterity content types do not provide IContentType and as such queryContentType(IMyType) returns 'None'.
Also:
IContentType.providedBy(IMyType)
returns 'False'.
Trying the same with a default content type also gives the same negative results.
Obviously, for my custom content type this can be resolved as follows:
....
from zope.interface import alsoProvides
....
class IMyType(model.Schema):
myField = schema.TextLine(
title=_(u"My Field:"),
)
alsoProvides(IMyType, IContentType)
queryContentType(IMyType) now returns the expected schema and IContentType.providedBy(IMyType) returns 'True'.
However, I would expect all Dexterity content types automatically providing IContentType. Am I expecting too much, or is this a bug in plone.dexterity and/or Plone 5.x ?
plone.dexterity 2.0+ only has a "soft dependency" on zope.app.content, and your build does not have it installed. Your add-on can have the desired interface provided on content type interfaces if you add zope.app.content to your setup.py
install_requiresand pin a version (3.5.1) in your buildout. Should you do this, all your content type schema/interface classes will provide IContentType.