[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/Browser - SQLScriptEdit.py:1.9
Jim Fulton
jim@zope.com
Sat, 7 Sep 2002 12:19:21 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv19433/lib/python/Zope/App/OFS/Content/SQLScript/Views/Browser
Modified Files:
SQLScriptEdit.py
Log Message:
More cleanup/refactoring of Schemas and forms. There's more to come,
but I'm checkpointing here.
I:
- Added schema field properties. These are like standard Python
properies except that they are derived from Schema fields.
- Decomposed Str fields into Bytes fields and Text fields.
Bytes fields contain 8-bit data and are stored as python strings.
Text fields contain written human discourse, and are stored as
unicode. It is invalid to store Python strings in Text fields or
unicode in Bytes fields.
- Moved converters from schemas to forms, where they are used.
- Widgets are now responsible for:
- Getting raw data from the request
- Converting raw data to application data
- Validating converted data against schema fields
- Began defining an error framework for errors in forms.
- Simplified FormViews to reflect new widget responsibilities.
- Added Bytes, Int and Float widgets and changed some application and
test code to use them.
=== Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/Browser/SQLScriptEdit.py 1.8 => 1.9 ===
--- Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/Browser/SQLScriptEdit.py:1.8 Thu Sep 5 14:55:03 2002
+++ Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/Browser/SQLScriptEdit.py Sat Sep 7 12:18:50 2002
@@ -18,7 +18,6 @@
from Zope.App.Forms.Views.Browser import Widget
from Zope.App.Forms.Widget import CustomWidget
from Zope.App.Forms.Views.Browser.FormView import FormView
-from Zope.Schema.Converter import StrToIntConverter
from Zope.App.OFS.Content.SQLScript.ISQLScript import ISQLScript
class SQLScriptEdit(FormView):
@@ -30,10 +29,9 @@
height=3, width=40),
'source': CustomWidget(Widget.TextAreaWidget,
height=10, width=80),
- 'maxCache': CustomWidget(Widget.TextWidget,
- converter=StrToIntConverter()),
- 'cacheTime': CustomWidget(Widget.TextWidget,
- converter=StrToIntConverter()) }
+ 'maxCache': Widget.IntWidget,
+ 'cacheTime': Widget.IntWidget,
+ }
fields_order = ('connectionName', 'arguments', 'source',
'maxCache', 'cacheTime')