[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - vocabularywidget.py:1.45
Fred L. Drake, Jr.
fred@zope.com
Wed, 18 Jun 2003 11:09:47 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv6095
Modified Files:
vocabularywidget.py
Log Message:
Make the vocabulary widget factory responsible for calling the query view's
setWidget() method, since what is passed is not specific to the actual
widget.
=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.44 => 1.45 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.44 Tue Jun 17 16:12:02 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py Wed Jun 18 11:09:16 2003
@@ -99,6 +99,7 @@
queryname = "widget-query%s-helper" % modifier
queryview = getView(query, queryname, request)
view.setQuery(query, queryview)
+ queryview.setWidget(view)
return view
@@ -557,6 +558,8 @@
# This specifically isn't a widget in it's own right, but is a
# form of BrowserView (at least conceptually).
+ widget = None
+
def __init__(self, context, request):
self.vocabulary = context.vocabulary
self.context = context
@@ -566,6 +569,11 @@
def setName(self, name):
assert not name.endswith(".")
self.name = name
+
+ def setWidget(self, widget):
+ assert self.widget is None
+ assert widget is not None
+ self.widget = widget
def renderInput(self):
return self.renderQueryInput()