[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Adder.py:1.1.2.9 Contents.py:1.1.2.7
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 15:34:48 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Zope/App/OFS/Container/Views/Browser
Modified Files:
Tag: Zope-3x-branch
Adder.py Contents.py
Log Message:
Implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification
Along the way:
- Converted most uses of has_key to use in.
- Fixed a bug in Interface names and namesAndDescriptions methods
that caused base class attributes to be missed.
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Adder.py 1.1.2.8 => 1.1.2.9 ===
context = self.context
- if id in context.objectIds():
+ if id in context.keys():
raise DuplicateIDError, "ID '%s' already in use." % id
# Create the new object
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py 1.1.2.6 => 1.1.2.7 ===
"""
try:
- self.context.delObject( name )
+ del self.context[name]
except KeyError:
if not silent:
raise
return self.confirmRemoved( name=name )
def listContentInfo(self):
- return map(self._extractContentInfo, self.context.objectItems())
+ return map(self._extractContentInfo, self.context.items())
index = ViewPageTemplateFile('main.pt')
confirmRemoved = ViewPageTemplateFile('remove_confirmed.pt')