[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/adapter - __init__.py:1.4

Garrett Smith garrett at mojave-corp.com
Fri Mar 5 23:17:51 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/browser/services/adapter
In directory cvs.zope.org:/tmp/cvs-serv15646/src/zope/app/browser/services/adapter

Modified Files:
	__init__.py 
Log Message:
Merged changes from garrett-widgets2-branch:

- Changed the way widgets are looked up to use interfaces instead of 
  names.
  
- Refactor of zope/app/form/utility.py -- see 

    http://dev.zope.org/Zope3/WidgetsAndMultiwayAdapters
    
  for details.
  
- Moved configuration of vocab widgets to its own zcml file
  (zope/app/browser/form/vocabularywidget.zcml).

- Removed 'propertyNames' and 'getValue' from widgets. This  is replaced
  by accessing the widget attributes directly.
  
- Deleted depreated methods from widget interface: haveData and getData.


=== Zope3/src/zope/app/browser/services/adapter/__init__.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/services/adapter/__init__.py:1.3	Wed Feb 25 18:02:19 2004
+++ Zope3/src/zope/app/browser/services/adapter/__init__.py	Fri Mar  5 23:17:20 2004
@@ -32,7 +32,8 @@
 
 from zope.app.services.adapter import IAdapterRegistration
 from zope.app.interfaces.services.registration import IRegistration
-from zope.app.form.utility import getWidgetsDataForContent
+from zope.app.interfaces.form import IInputWidget
+from zope.app.form.utility import applyWidgetsChanges
 from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCreatedEvent
 from zope.app.services.adapter import AdapterRegistration
@@ -41,16 +42,15 @@
 
     def __init__(self, *args):
         super(AdapterRegistrationAdd, self).__init__(*args)
-        setUpWidgets(self, IAdapterRegistration)
+        setUpWidgets(self, IAdapterRegistration, IInputWidget)
 
     def refresh(self):
         if "FINISH" in self.request:
-            data = getWidgetsData(self, IAdapterRegistration, strict=True)
+            data = getWidgetsData(self, IAdapterRegistration)
             registration = AdapterRegistration(**data)
             publish(self.context.context, ObjectCreatedEvent(registration))
             registration = self.context.add(registration)
-            getWidgetsDataForContent(self, IRegistration, registration,
-                                     strict=False)
+            applyWidgetsChanges(view, IRegistration, target=registration) 
             self.request.response.redirect(self.context.nextURL())
             return False
 




More information about the Zope3-Checkins mailing list