[z3-five] browser: page and allowed_interface
George Lee
georgeleejr at gmail.com
Sat Oct 7 19:34:04 CEST 2006
Currently Five processes the "browser:page" and "allowed_interface" as follows,
in method page of Products.Five.browser.metaconfigure:
if allowed_interface is not None:
for interface in allowed_interface:
allowed_attributes.extend(interface.names())
However, if an interface subclasses another interface, then the superclass
interface's names are not included in the allowed attributes! This seems very
counter-intuitive.
It seems that the code should use list(interface) instead of interface.names()
-- is this correct?
For example, I may want IFoo1 and IFoo2 both to have allowed names foo, bar,
wam, kazam, but where IFoo1 has name foo1 and IFoo2 has name foo2. Right now,
the only ways to allow all those name on IFoo1 are:
* to define all those names explicitly in both IFoo1 and IFoo2 -- which
results in useless duplication of code
* to set allowed_attributes to both IFoo and IFoo1 -- which violates the
principle that we should know what names are listed in IFoo1 without knowing
what superclasses it inherits from
Peace,
George
More information about the z3-five
mailing list