[Zope-CMF] Re: GenericSetup list property purge

yuppie y.2006_ at wcm-solutions.de
Tue Jan 17 04:28:49 EST 2006


Hi Florent!


Florent Guillaume wrote:
> Florent Guillaume wrote:
>> I recently introduced the fact that in extension profiles list  
>> properties aren't purged by default.
>> But really this introduces problems, as if you simply import an  
>> extension profile twice you'll get all you lists doubled.
>>
>> So I think I'll use the opposite semantic, closer to what was the  
>> case before: purge by default for lists even in extension profiles,  
>> except if purge="False" is present on the property.
> 
> I checked this in.
> 
> But actually this revealed what I think is slightly unclear behaviour in 
> the case of loading extension profiles: the extension profile can 
> happily modify objects without them being purged, but I believe that as 
> soon as it has to create a new object, the import context should be 
> switched to _should_purge=True for that object and the recursion inside it.
> 
> What do you think?

I don't like that idea:

- Applying the settings to a new object should always have the same 
result as applying them to a purged object. If everything is implemented 
that way changing the purge mode to True doesn't make any difference in 
deeper levels.

- You would need a way to mark those parts of the extension profile that 
should always create new objects (or purge them if they already exist). 
We already have purge="True" for that.

- I can't see how this would resolve your issue for purge="False".


The handlers for other sequences (like skin paths and object managers) 
just add new sequence items if the item doesn't exist already. Wouldn't 
that also work for list properties?


Cheers,

	Yuppie



More information about the Zope-CMF mailing list