<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font><br><a href="http://grok.zope.org/doc/current/reference/directives.html#grok-adapts-declare-that-a-class-adapts-certain-objects">http://grok.zope.org/doc/current/reference/directives.html#grok-adapts-declare-that-a-class-adapts-certain-objects</a><br><br>When I try this technique and create a new object based on the interface that specifies the schema, it does not work (the point of this thread). <br><br>Should that example be removed from the reference? </div></blockquote><div><br></div><div>Yeah, that example isn't particulary helpful. It's got code which isn't used (such as the schema default) and it doesn't work (MammothSize needs to inherit from grok.Adapter). Perhaps a more simple example could be used ... but for now I've just removed the example. I also *attempted* to clarify the usage of grok.adapts() with:</div><div><br></div><div><div>In the case of a simple adapter which only requires a single object</div><div>for adapation, the :func:`grok.context` directive is used to declare</div><div>the interface or class the adapter is for. It is only necessary to use</div><div>:func:`grok.adapts` to declare the adapation requirements for a multi adapter.</div></div><div><br></div><div>But for a simple adapter, one can:</div><div><br></div><div>&nbsp;- not declare the context when it's unambigous</div><div>&nbsp;- declare the context when it is ambigous, or delcare it for the sake of declartion with grok.context()</div><div>&nbsp;- use grok.adapts() instead of grok.context()</div><div><br></div><div>So maybe the text should be updated to reflect that, or is there a strong enough style conses that a particular method is used for registering simple adapters (e.g. using grok.context over grok.adapts)?</div><div><br></div><div><br></div></div></body></html>