[Grok-dev] distinction between adapts() and context()

Brandon Craig Rhodes brandon at rhodesmill.org
Tue Mar 18 23:24:24 EDT 2008

Why does the AdapterGrokker() in grok/meta.py look only for a
grok.context() declaration on an adapter, and not pay any attention to
native Zope .adapts() information on the class?  I think it would be
nice if it accepted either directive, but I wanted to ask and find out
if it was omitted on purpose for some reason I'm not thinking of this
late at night. :-)

It has always felt to me as though grok.context() is basically a
synonym for grok.adapts(), but one that's named so that we can hide
from people just writing Views the big concept that they're actually
writing a well-known object-oriented design pattern in order to suit
their objects up for the web.

Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon

More information about the Grok-dev mailing list