[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/browser/ The
presentation service is gone.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Sep 17 12:16:19 EDT 2004
Log message for revision 27590:
The presentation service is gone.
Use adapter service instead.
Changed:
U Zope3/trunk/src/zope/app/form/browser/add.py
U Zope3/trunk/src/zope/app/form/browser/schemadisplay.py
-=-
Modified: Zope3/trunk/src/zope/app/form/browser/add.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/add.py 2004-09-17 16:16:16 UTC (rev 27589)
+++ Zope3/trunk/src/zope/app/form/browser/add.py 2004-09-17 16:16:19 UTC (rev 27590)
@@ -21,6 +21,7 @@
from zope.app import zapi
from zope.event import notify
+from zope.interface import Interface
from zope.app.event.objectevent import ObjectCreatedEvent, ObjectModifiedEvent
from zope.app.form.utility import setUpWidgets, getWidgetsData
@@ -142,7 +143,6 @@
keyword_arguments, set_before_add, set_after_add,
menu=u''):
- s = zapi.getGlobalService(zapi.servicenames.Presentation)
class_ = SimpleViewClass(
template,
used_for = schema, bases = bases
@@ -166,5 +166,8 @@
permission,
)
)
-
- s.provideView(for_, name, IBrowserRequest, class_, layer)
+ if layer is None:
+ layer = IBrowserRequest
+
+ s = zapi.getGlobalService(zapi.servicenames.Adapters)
+ s.register((for_, layer), Interface, name, class_)
Modified: Zope3/trunk/src/zope/app/form/browser/schemadisplay.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/schemadisplay.py 2004-09-17 16:16:16 UTC (rev 27589)
+++ Zope3/trunk/src/zope/app/form/browser/schemadisplay.py 2004-09-17 16:16:19 UTC (rev 27590)
@@ -17,15 +17,15 @@
"""
__docformat__ = 'restructuredtext'
-from zope.app import zapi
-
+from zope.interface import Interface
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.schema import getFieldNamesInOrder
+from zope.security.checker import defineChecker, NamesChecker
-from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app import zapi
from zope.app.location.interfaces import ILocation
from zope.app.location import LocationProxy
from zope.app.publisher.browser import BrowserView
-from zope.security.checker import defineChecker, NamesChecker
from zope.app.form.utility import setUpDisplayWidgets
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
@@ -88,5 +88,9 @@
defineChecker(class_,
NamesChecker(("__call__", "__getitem__", "browserDefault"),
permission))
- s = zapi.getGlobalService(zapi.servicenames.Presentation)
- s.provideView(for_, name, IBrowserRequest, class_, layer)
+
+ if layer is None:
+ layer = IBrowserRequest
+
+ s = zapi.getGlobalService(zapi.servicenames.Adapters)
+ s.register((for_, layer), Interface, name, class_)
More information about the Zope3-Checkins
mailing list