[Zope-CMF] Re: GenericSetup: allowed_container_types

Florent Guillaume fg at nuxeo.com
Wed Jan 4 14:17:06 EST 2006


On 13 Dec 2005, at 13:50, yuppie wrote:
> Florent Guillaume wrote:
>> On 13 Dec 2005, at 12:50, yuppie wrote:
>>>
>>> I'd propose to implement an update mode for list properties and  
>>> to add an update file for each allowed container. Something like  
>>> that:
>>>
>>> <object name="MyContainer">
>>>  <property name="allowed_content_types">
>>>   <element value="MyType"/>
>>>  </property>
>>> </object>
>>>
>>> (Didn't have a look at the code. I guess this currently  
>>> overwrites the list and maybe that's what it should do by  
>>> default. But we could add an explicit mode="update" to enforce an  
>>> update mode.)
>> Yes that was another option I'd considered but found more complex,  
>> but if you think it's ok I'll look at how to implement it.
>
> Yes, I prefer this option. It should be easy to implement and also  
> useful for other properties. Workflow bindings are set in a similar  
> way, see the example in the CMFTopic profile.
>
>> The mode="update" would be an attribute of <property>, right ?
>
> Yes. But just found that I already use purge="False" for action  
> handlers. I guess this is better than mode="update".

I can't find any code for purge="False".

> Workflow bindings don't need that attribute - they are always in  
> update mode if self.environ.shouldPurge() is False. Maybe it would  
> be better to make the shouldPurge setting the default for  
> properties as well. And override it with purge="True" if necessary.  
> Don't know.

On the other hand the object importer and the skins layer importer  
check insert-before and insert-after. I'll reuse that, even if in my  
use case the list order doesn't matter.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com




More information about the Zope-CMF mailing list