[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publisher/browser/configure.zcml Allowed annotations on the BrowserRequest

Benji York benji at zope.com
Thu Nov 3 10:01:37 EST 2005


Dmitry Vasiliev wrote:
 > With '__annotations__' you can just use standard IAnnotations adapter.

A few issues.

1) The change you made to zope/app/publisher/browser/configure.zcml is
not sufficient to allow you to create an __annotations__ attribute on a
request, because requests have a __slots__ attribute which disallow new
attribute assignment to requests.  If adding arbitrary attributes to
requests works, it is a bug.

2) Requests already have an "annotations" attribute which has been there
since 3.1, so __annotations__ is redundant.

3) You don't need the "annotations" framework for this, but if you
really want it, making annotations work with the existing
request.annotations attribute is easy.
-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the Zope3-Checkins mailing list