[Zope3-checkins]
SVN: Zope3/branches/philikon-widget-subdirective/src/zope/app/form/browser/metaconfigure.py
based on which interface the widget class provides, call the right
Philipp von Weitershausen
philikon at philikon.de
Sun Jun 12 10:13:14 EDT 2005
Log message for revision 30761:
based on which interface the widget class provides, call the right
widget factory
Changed:
U Zope3/branches/philikon-widget-subdirective/src/zope/app/form/browser/metaconfigure.py
-=-
Modified: Zope3/branches/philikon-widget-subdirective/src/zope/app/form/browser/metaconfigure.py
===================================================================
--- Zope3/branches/philikon-widget-subdirective/src/zope/app/form/browser/metaconfigure.py 2005-06-12 14:12:10 UTC (rev 30760)
+++ Zope3/branches/philikon-widget-subdirective/src/zope/app/form/browser/metaconfigure.py 2005-06-12 14:13:14 UTC (rev 30761)
@@ -31,8 +31,11 @@
from zope.app.publisher.browser.menumeta import menuItemDirective
from zope.app.i18n import ZopeMessageIDFactory as _
-from zope.app.form import CustomWidgetFactory
+from zope.app.form import CustomWidgetFactory, CustomSequenceWidgetFactory
+from zope.app.form import CustomVocabularyWidgetFactory
from zope.app.form.interfaces import IInputWidget, IDisplayWidget
+from zope.app.form.interfaces import ISequenceWidgetFactory
+from zope.app.form.interfaces import IVocabularyWidgetFactory
from add import AddView, AddViewFactory
from editview import EditView, EditViewFactory
from formview import FormView
@@ -86,7 +89,13 @@
# attribute. This can be used to override some of the
# presentational attributes of the widget implementation.
class_ = self._default_widget_factory
- self._widgets[field+'_widget'] = CustomWidgetFactory(class_, **attrs)
+ if ISequenceWidgetFactory.providedBy(class_):
+ widget = CustomSequenceWidgetFactory(class_, **attrs)
+ elif IVocabularyWidgetFactory.providedBy(class_):
+ widget = CustomVocabularyWidgetFactory(class_, **attrs)
+ else:
+ widget = CustomWidgetFactory(class_, **attrs)
+ self._widgets[field+'_widget'] = widget
def _processWidgets(self):
if self._widgets:
More information about the Zope3-Checkins
mailing list