[Zope-CMF] Re: [dev] name lookup in skin: some questions

Casey Duncan casey at zope.com
Wed Jun 2 11:50:09 EDT 2004


On Wed, 02 Jun 2004 14:53:24 +0200
yuppie <y.2004_ at wcm-solutions.de> wrote:

> Hi!
> 
> 
> After adding a print statement to SkinnableObjectManager.__getattr__,
> I get this list of name lookups in the skin if calling index_html of a
> new CMF Site root object:
> 
> 
> index_html
> im_func
> main_template
> main_template
> role_map
> allow_discussion
> sort-on
> sort-limit
> listActionInfos
> listActions
> expanded_title
> expanded_title
> zpt_stylesheet.css
> zpt_stylesheet.css
> CalendarStyle.css
> truncID
> truncID
> calendarBox
> breadcrumbs
> breadcrumbs
> index_html_utils
> index_html_utils
> show_content_types
> show_link_types
> show_folder_types
> TitleOrId
> TitleOrId
> sort-order
> caching_policy_manager
> 
> 
> 1.) Wouldn't it be better to exclude names like 'im_func' and
> 'role_map' 
>   from skin lookup?

Strange that it looks up sort-on, sort-limit and sort-order. Those are
arguments to the catalog, not script names. Wonder where those are
coming from.

> 2.) I didn't debug this. Does anybody know why skin methods are always
> 
> looked up twice? Would it make sense to cache all lookups within a 
> request, not just those that failed?

This is probably caused in the traversal code. There is at least one
hasattr/getattr pair in there and calls out the the security machinery
may do lookups to. To my eye it looks like there are optimizations to be
had in there.

-Casey




More information about the Zope-CMF mailing list