[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/component/site.txt
Removed unnecessary definitions of __parent__ and __name__.
Jim Fulton
jim at zope.com
Mon Feb 21 11:34:55 EST 2005
Log message for revision 29237:
Removed unnecessary definitions of __parent__ and __name__.
These are taken care of by subsclassing Contained. I hadn't noticed
this before.
Changed:
U Zope3/trunk/src/zope/app/component/site.txt
-=-
Modified: Zope3/trunk/src/zope/app/component/site.txt
===================================================================
--- Zope3/trunk/src/zope/app/component/site.txt 2005-02-21 16:29:00 UTC (rev 29236)
+++ Zope3/trunk/src/zope/app/component/site.txt 2005-02-21 16:34:55 UTC (rev 29237)
@@ -136,7 +136,6 @@
>>> import persistent
>>> from zope.app.container.contained import Contained
>>> class MyUtility(persistent.Persistent, Contained):
- ... __parent__ = __name__ = None
... zope.interface.implements(IMyUtility,
... interfaces.ILocalUtility)
... def __init__(self, title):
@@ -144,10 +143,6 @@
... def __repr__(self):
... return "%s('%s')" %(self.__class__.__name__, self.title)
-Note the definition of the __parent__ and __name__ attributes. This
-is required because we have to declare that we implement ILocalUtility
-and ILocalUtility extends ILocation, which specified these attributes.
-
Now we can create an instance of our utility and put it in the site
management folder:
More information about the Zope3-Checkins
mailing list