AW: AW: [Zope3-dev] Release for Views As Adapters

dev at projekt01.ch dev at projekt01.ch
Tue Sep 28 09:03:37 EDT 2004


Stephan Richter wrote:
> Betreff: Re: AW: [Zope3-dev] Release for Views As Adapters
> 
> 
> On Monday 27 September 2004 18:55, dev at projekt01.ch wrote:
> > > These particular changes are no cause for a new release.
> >
> > We use some removed concepts like:
> >
> >     _context.action(
> >         discriminator = ('view', for_, name,
> IBrowserRequest, layer),
> >         callable = handler,
> >         args = (zapi.servicenames.Presentation, 'provideAdapter',
> >                 IBrowserRequest, new_class, name, for_, Interface,
> > layer,
> >                 _context.info),
> >         )
> >
> > Is there a way for to register this views for both version of z3?
> 
> I think writing your own directives, including defining views
> is fair game. 
> However, I think you duplicate a lot of work this way. I 
> would recommend that 
> you simply reuse the `zope:view` handler function. This way, 
> if I change the 
> underlying framework and update `zope:view` in a 
> backward-compatible way, you 
> are automatically updated as well. BTW, I use existing 
> directive handlers all 
> the time.
> 
> So in you case you should call:
> 
> from zope.app.component.metaconfigure import view
> 
> view(_context, new_class, IBrowserRequest, name, for_, layer)
> 
> That's it!

Ok, I will try to change this part.

Thanks 
Roger

> 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-dev mailing list