Skip to content

Commit

Permalink
Added note in docs on how to avoid TypeError: Missing 'provides' attr…
Browse files Browse the repository at this point in the history
…ibute, when using a browser layer aware extender.
  • Loading branch information
mauritsvanrees committed Nov 18, 2011
1 parent 832a457 commit 38f9d69
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,15 @@ Below is an example of ``extender.py`` which adds new field on *Dates* edit tab:
"""
@return: List of new fields we contribute to content.
"""
return self.fields
return self.fields

Note: since the above example has two interfaces in its ``implements``
line, you will get an error when your Zope instance starts up::

TypeError: Missing 'provides' attribute

This means we need to be more explicit in our zcml configuration and
specify which of the two interfaces is provided by our adapter::

<adapter factory=".extender.RevisitExtender"
provides="archetypes.schemaextender.interfaces.ISchemaExtender" />

0 comments on commit 38f9d69

Please sign in to comment.