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

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Nov 3 10:44:00 EST 2005


On Thursday 03 November 2005 10:25, Dmitry Vasiliev wrote:
> 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.

Since "annotations" is already there in 3.1, it will be easier to adjust the 
new code to this attribute instead of deprecating annotations and introducing 
__annotations__, unless Dimitry is willing to do that. :-) I agree with 
Dimitry that using __annotations__ makes more sense, since this is what we 
use anywhere else.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-Checkins mailing list