[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - configure.zcml:1.11 vocabularywidget.py:1.9

Casey Duncan casey@zope.com
Thu, 29 May 2003 10:33:03 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv9644/form

Modified Files:
	configure.zcml vocabularywidget.py 
Log Message:
Fix vocabulary widget config and value lookup in __call__


=== Zope3/src/zope/app/browser/form/configure.zcml 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/form/configure.zcml:1.10	Wed May 28 17:24:58 2003
+++ Zope3/src/zope/app/browser/form/configure.zcml	Thu May 29 10:33:02 2003
@@ -162,7 +162,7 @@
       permission="zope.Public"
       type="zope.publisher.interfaces.browser.IBrowserPresentation"
       factory=".vocabularywidget.VocabularyEditWidget"
-      name="field-edit"
+      name="field-edit-widget"
       for="zope.schema.interfaces.IVocabulary"
       />
       
@@ -170,7 +170,7 @@
       permission="zope.Public"
       type="zope.publisher.interfaces.browser.IBrowserPresentation"
       factory=".vocabularywidget.VocabularyDisplayWidget"
-      name="field-display"
+      name="field-display-widget"
       for="zope.schema.interfaces.IVocabulary"
       />
       


=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.8	Wed May 28 14:26:40 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py	Thu May 29 10:33:02 2003
@@ -139,7 +139,11 @@
         if self.haveData():
             value = self._showData()
         else:
-            value = self.context.get(self.context.context)
+            field = self.context
+            try:
+                value = field.get(field.context)
+            except AttributeError:
+                value = field.default
         return self.render(value)
 
     def render(self, value):