[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI/Views/Browser - GenericCreatorView.py:1.1.4.4.4.1

Jim Fulton jim@zope.com
Wed, 29 May 2002 11:10:19 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/ZMI/Views/Browser

Modified Files:
      Tag: Zope3InWonderland-branch
	GenericCreatorView.py 
Log Message:
- Added permission_id attribute to adapter and utility directives.

- Got rid of old getView, getResource, and getDefaultViewName.
  Renamed getRequestView to getView (and so on).

  Changed view interface to use context, rather than getContext.

  Introduced notion of presentation types (e.g. IBrowserPresentation, 
  which is cleaner than IBrowserPublisher).

- Began converting to get/queryFoo, which is much nicer.

- Many formatting fixups.



=== Zope3/lib/python/Zope/App/ZMI/Views/Browser/GenericCreatorView.py 1.1.4.4 => 1.1.4.4.4.1 ===
 # 
 ##############################################################################
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.App.ZMI.IGenericCreatorMarker import IGenericCreatorMarker
 from Zope.Proxy.ContextWrapper import getWrapperContext
 from Zope.App.OFS.Container.Exceptions import DuplicateIDError
 from Zope.ComponentArchitecture import createObject
 
-class GenericCreatorView(AttributePublisher):
+class GenericCreatorView(BrowserView):
     """Provide an interface for editing a contact
     """
 
-    # Boiler plate
-    def __init__(self, context):
-        self._context=context
-
-    def getContext(self):
-        return self._context
-
     # Assert that we can only be applied to IGenericCreatorMarker
     __used_for__=IGenericCreatorMarker
 
@@ -40,7 +33,7 @@
         """Create an item of the class identified by the Addable (held
         in _context) within the container that is the parent of the
         Addable"""
-        addable=self.getContext()
+        addable=self.context
         container=getWrapperContext(addable)
         
         if name in container.objectIds():