[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:16 EDT 2004


Log message for revision 27589:
  
  The presentation service is gone.
  
  Layers are interfaces now.
  
  


Changed:
  U   Zope3/trunk/src/zope/app/form/browser/editview.py
  U   Zope3/trunk/src/zope/app/form/browser/metaconfigure.py
  U   Zope3/trunk/src/zope/app/form/browser/tests/test_add.py


-=-
Modified: Zope3/trunk/src/zope/app/form/browser/editview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/editview.py	2004-09-17 16:16:14 UTC (rev 27588)
+++ Zope3/trunk/src/zope/app/form/browser/editview.py	2004-09-17 16:16:16 UTC (rev 27589)
@@ -20,6 +20,7 @@
 from datetime import datetime
 from transaction import get_transaction
 
+from zope.interface import Interface
 from zope.schema import getFieldNamesInOrder
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.security.checker import defineChecker, NamesChecker
@@ -130,7 +131,6 @@
 def EditViewFactory(name, schema, label, permission, layer,
                     template, default_template, bases, for_, fields,
                     fulledit_path=None, fulledit_label=None, menu=u''):
-    s = zapi.getGlobalService(zapi.servicenames.Presentation)
     class_ = SimpleViewClass(template, used_for=schema, bases=bases)
     class_.schema = schema
     class_.label = label
@@ -148,5 +148,8 @@
                   NamesChecker(("__call__", "__getitem__",
                                 "browserDefault", "publishTraverse"),
                                permission))
+    if layer is None:
+        layer = IBrowserRequest
 
-    s.provideView(for_, name, IBrowserRequest, class_, layer)
+    s = zapi.getGlobalService(zapi.servicenames.Adapters)
+    s.register((for_, layer), Interface, name, class_)

Modified: Zope3/trunk/src/zope/app/form/browser/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/metaconfigure.py	2004-09-17 16:16:14 UTC (rev 27588)
+++ Zope3/trunk/src/zope/app/form/browser/metaconfigure.py	2004-09-17 16:16:16 UTC (rev 27589)
@@ -43,7 +43,7 @@
 
     # default basic information
     for_ = None
-    layer = 'default'
+    layer = IBrowserRequest
     permission = 'zope.Public'
     template = None
     class_ = None

Modified: Zope3/trunk/src/zope/app/form/browser/tests/test_add.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/tests/test_add.py	2004-09-17 16:16:14 UTC (rev 27588)
+++ Zope3/trunk/src/zope/app/form/browser/tests/test_add.py	2004-09-17 16:16:16 UTC (rev 27589)
@@ -15,7 +15,6 @@
 
 $Id$
 """
-
 import unittest
 
 from zope.app.tests import ztapi
@@ -157,7 +156,7 @@
 
         self.assertEqual(descriminator,
                          ('view', IAdding, "addthis", IBrowserRequest,
-                          "default"))
+                          IBrowserRequest))
         self.assertEqual(callable, AddViewFactory)
 
         (name, schema, label, permission, layer, template,
@@ -169,7 +168,7 @@
         self.assertEqual(schema, I)
         self.assertEqual(label, 'Add this')
         self.assertEqual(permission, 'zope.Public')
-        self.assertEqual(layer, 'default')
+        self.assertEqual(layer, IBrowserRequest)
         self.assertEqual(template, 'add.pt')
         self.assertEqual(default_template, 'add.pt')
         self.assertEqual(bases, (V, AddView, ))



More information about the Zope3-Checkins mailing list