Hi Miles!
Miles Waller wrote:
I have a question about aliases in the types tool that I'm hoping some
can answer pretty easily.
In the management screen, there's a line which says:
For backwards compatibility there is also a '(Default)' method:
Calls index_html or __call__, depending on the class
For some old type information in a project here, the guess aliases
process assigns the alias '(Default)' with the method (Default). This
in turn creates an attribute error, as there is no method '(Default)'.
Without seeing the traceback I can't tell what's exactly going wrong
here. DynamicType.__before_publishing_traverse__ should do this right.
There might be other places where queryMethodID is used and '(Default)'
not handled correctly.
What I want to know is, is this an error (i.e. if the alias (Default)
also points to a method (Default), should this just be ignored) or is
there some use for this behaviour? I'd like to fix this for my type
infomration, but don't want to mask anything clever.
_guessMethodAliases is not very clever. If index_html of your types is
not None you just can replace '(Default)' by 'index_html'. If the
__call__ method has no complex logic you might be able to replace
'(Default)' by a real method. This would be much saner than using the
'(Default)' backwards compatibility hack.
HTH,
Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf
See http://collector.zope.org/CMF for bug reports and feature requests