[Zope-CMF] Re: Adding context to FactoryTypeInformation.queryMethodID

Christian Heimes christian at cheimes.de
Tue Jun 14 09:48:48 EDT 2005


yuppie wrote:
> Hi Christian!
> 
> 
> Christian Heimes wrote:
> 
>> I'd like to change the queryMethodID method of FactoryTypeInformation 
>> in CMF 1.5 and HEAD. I want to reimplement Archetype's template mixin 
>> feature for CMF. (*)
>>
>> For the new feature I need the caller context in queryMethodID for a 
>> dynamic view template. I propose to alter the method from 
>> queryMethodID(self, alias, default=None) to queryMethodID(self, alias, 
>> default=None, context=None) and add context=self to all calls of 
>> queryMethodID.
> 
> 
> I'm not sure I understand what you propose:
> 
> - Just changing queryMethodID signature and calls?
> 
> - Or also adding the TemplateMixin stuff to CMFCore?
> 
> - Or also adding an UI for that to CMFDefault?

I'm proposing at least the first point in your list, changing the 
signature and calls. I'm going to implement the template mixin in a 
different way for Plone but I would be happy to contribute the feature 
to CMF.

> Zope 2.8/Five has a different machinery that allows to do something 
> similar: Adding marker interfaces to objects and specifying views for them.
> 
> This product implements the feature for Plone: 
> http://codespeak.net/svn/z3/Flon/trunk/
> 
> Is there a need to have TemplateMixin *and* marker interfaces? What are 
> the pros and cons of the two approaches?

The con against the marker interface is easy to explain: We need the 
feature in Plone 2.1 but we won't depend on ZopeX3 and Five. :)

Christian



More information about the Zope-CMF mailing list