[Zope3-checkins] CVS: Zope3/src/zope/app/form - utility.py:1.25.4.1
Garrett Smith
garrett at mojave-corp.com
Sun Feb 8 18:54:54 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/form
In directory cvs.zope.org:/tmp/cvs-serv22019/src/zope/app/form
Modified Files:
Tag: ozzope-widgets-branch
utility.py
Log Message:
Multiple changes:
- Added getViewProviding and queryViewProviding methods to zapi. These are
used to lookup a view based on an interface it provides.
- Fixed a misspecified interface in rotterdamn textarea edit widget.
- Rework of utility.py in progress - tests broken.
- Removed the old view service.
=== Zope3/src/zope/app/form/utility.py 1.25 => 1.25.4.1 ===
--- Zope3/src/zope/app/form/utility.py:1.25 Fri Jan 23 12:00:20 2004
+++ Zope3/src/zope/app/form/utility.py Sun Feb 8 18:54:23 2004
@@ -35,9 +35,9 @@
__metaclass__ = type
from warnings import warn
-from zope.component import getView, getDefaultViewName
from zope.schema import getFieldsInOrder
from zope.schema.interfaces import ValidationError
+from zope.app import zapi
from zope.app.interfaces.form import IWidget
from zope.app.interfaces.form import WidgetsError, MissingInputError
from zope.app.interfaces.form import InputErrors
@@ -129,9 +129,7 @@
if widget is None:
# There isn't already a widget, create one
field = field.bind(context)
- if vname is None:
- vname = getDefaultViewName(field, view.request)
- widget = getView(field, vname, view.request)
+ widget = zapi.getViewProviding(field, viewType, view.request)
setattr(view, wname, widget)
if not hasattr(view, name):
setattr(view, name, WhiningWidget(view, name, widget))
More information about the Zope3-Checkins
mailing list