[z3-five] Attribute gives: security declaration for nonexistent method

Maurits van Rees m.van.rees at zestsoftware.nl
Wed Apr 18 12:28:36 CEST 2007


Hi,

In an interface I have an Attribute:

    bookinglist = Attribute("List of individual Bookings")

Now when starting Zope, I get a warning:

WARNING Init Class Products.Five.metaclass.BookingListView \
has a security declaration for nonexistent method 'bookinglist'

Everything works as expected as far as I can see, so it does not look
like a real problem.  But is there a way to get rid of this warning?

Ah, the warning gets throws at the end of lib/python/App/class_init.py
as it can't find an attribute with the name 'bookinglist' in that
class.  And that is correct as I set that in the __init__.py of the
view class, so at Zope startup time it is not known.

So: should all Attributes of a browser view be set in the class
definition outside of the __init__()?  Well, all Attributes that are
indicated by the Interface at least.  Correct?

It gets rid of the warning anyway and looks like good practice.

-- 
Maurits van Rees | http://maurits.vanrees.org/ [NL]
            Work | http://zestsoftware.nl/
"Do not worry about your difficulties in computers,
 I can assure you mine are still greater."



More information about the z3-five mailing list