[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/browser - form.py:1.9
Fred L. Drake, Jr.
fred@zope.com
Tue, 20 May 2003 12:10:59 -0400
Update of /cvs-repository/Zope3/src/zope/app/interfaces/browser
In directory cvs.zope.org:/tmp/cvs-serv24680/src/zope/app/interfaces/browser
Modified Files:
form.py
Log Message:
Merge schema-vocabulary-branch into the trunk.
Preliminary documentation on vocabularies and schema vocabulary fields
can be found at http://dev.zope.org/Zope3/VocabularyFields.
=== Zope3/src/zope/app/interfaces/browser/form.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/browser/form.py:1.8 Thu May 1 15:35:21 2003
+++ Zope3/src/zope/app/interfaces/browser/form.py Tue May 20 12:10:28 2003
@@ -155,3 +155,47 @@
def update():
"""Update the form with data from the request.
"""
+
+
+class IVocabularyQueryView(Interface):
+ """View support for IVocabularyQuery objects.
+
+ Implementations of this interface are used by vocabulary field
+ edit widgets to support query and result presentations.
+ """
+
+ def setName(name):
+ """Set the name used to compute the form field names.
+
+ Form field names should be the given name, or additional name
+ components separated by dots may be appended if multiple form
+ fields are needed.
+
+ This will be called immediately after the IVocabularyQueryView
+ has been created; form values may be extracted as a result of
+ calling this method.
+ """
+
+ def performAction(value):
+ """Perform any action indicated by any submit buttons in the
+ sub-widget.
+
+ 'value' is the current value of the field. Submit actions may
+ cause the value to be modified. If so, the new value should
+ be returned; otherwise the old value should be returned.
+
+ Actions should only be performed if a submit button provided
+ by the view was selected.
+
+ This method will be called after setName() and before
+ renderInput() or renderResults().
+ """
+
+ def renderInput():
+ """Return a rendering of the input portion of the widget."""
+
+ def renderResults(value):
+ """Return a rendering of the results portion of the widget.
+
+ 'value' is the current value represented by the widget.
+ """