[Zope-dev] Doc strings of IContentProvider
Thomas Lotze
thomas at thomas-lotze.de
Sun Nov 11 13:34:06 EST 2007
While trying to implement the outcome of that zope3-dev discussion on
pagelets being content providers, I noticed that the doc strings for
IContentProvider talk about how content providers are to be looked up:
They specify (informally) that content providers are discriminated by
context, request, and view. Also, the documentation of the __parent__
attribute states that the parent is a view.
To my understanding, the interface should only specify how an object
behaves, not how it is obtained. Moreover, I suspect that it might be
enough to require the presence of a parent for the sake of the security
context (as stated in the doc string) without specifying that it must be a
view. The way it is now, a view whose parent is something other than a
view can never be its own content provider. As an example, this includes
pagelets. Unless this is a conscious design choice, IMHO the interface's
documentation should be worded more liberally.
--
Thomas
More information about the Zope-Dev
mailing list