[Zope-CMF] Re: method aliases

Andrew Sawyers andrew@zope.com
Tue, 29 Jul 2003 14:28:36 -0400


My recent perceptions having to deal with this exact issue on Friday.......
Yuppie wrote:

>
> 3.) To do migration 'on the fly', we need a criterion to find out if 
> migration is necessary. Right now this criterion is the existence of 
> the 'aliases' dict. An other posibility would be to introduce 
> something like a version number for ftis.
>
>
> Any ideas to improve this are welcome.
>
>
> Cheers,
>
> Yuppie
>   

I think the strangeness partially comes from when we don't want to do 
the migration, you have to be aware of hoops to get your new types to 
work in CMF1.4.  Adding a type with an action like: 'action':  
"python:object.someMethod() + '/some_template.html'" blows up because 
it's trying to compile the expression when you add the type to the types 
tool - of course this returns None and blows up.  
IIRC this bit of code was the culprit:
aliases = kw.get( 'aliases', _marker )
        if aliases is _marker:
            self._guessMethodAliases()
        else:
            self.setMethodAliases(aliases)
I did not step past figuring out the work around (i.e. adding the 
aliases dict. to my type information).
It seems like for types that don't have an aliases dict, you wouldn't 
want to compile the action at add time....no?  I'm not sure why you'd 
want to compile any expressions when you're adding the type; but I could 
have overlooked something.
Andrew