[Zope-CMF] Re: [CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.26

Shane Hathaway shane@zope.com
Sun, 10 Mar 2002 00:41:55 -0500


Chris Withers wrote:
> Tres Seaver wrote:
> 
>>I don't think this does what you want 
>>
> 
> Well, the tests pass and it works in the production environment I'm using it in
> ;-)
> 
> 
>>-- it only filters based on
>>*identity* (the exact same object), rather than by *equivalence*
>>(I'm not sure what this would mean, but perhaps the combination of
>>title and URL?) 
>>
> 
> I think I mean identity, since ActionInformation objects are persistent.
> 
> I just wanted to stop duplicates happening when the object has a listActions
> method.
> 
> In my case, I have a PageTemplate that acts in the context of the membership
> tool and so any actions the membership tool generates were duplicated.

That sounds like it'll work, but it only removes a certain kind of 
duplicates.  The code in that place was intended to be replaced with 
something that really knew how to remove duplicates, but it's hard to 
define "duplicate action" other than in the very narrow sense of 
comparing by identity.  So that code is probably good but I'd hope to 
see a different comment next to it, to the effect of "remove actions 
that are obviously duplicated based on simple identity, but don't try to 
remove all duplicates".

Shane