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

Dmitry Vasiliev lists at hlabs.spb.ru
Thu Nov 3 10:25:47 EST 2005


Benji York wrote:
> 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.

The slot for '__annotations__' has already been added in revision 39629.

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

Oops, I didn't find that before

> 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.

I've used the framework as the standard way to annotate something.

So I can change ModifiableBrowserLanguages adapter to use the 'annotations' 
attribute, but I really like if we will be use only one way to annotate.

-- 
Dmitry Vasiliev (dima at hlabs.spb.ru)
     http://hlabs.spb.ru


More information about the Zope3-Checkins mailing list