[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - editview.py:1.11 add.py:1.9
Albertas Agejevas
alga@codeworks.lt
Fri, 21 Feb 2003 09:53:35 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv25770/app/browser/form
Modified Files:
editview.py add.py
Log Message:
Changed the browser:editform to clear the values which are missing or
empty in the form by default.
Added a keyword argument set_missing to getWidgetsData() and
getWidgetsDataForContent().
Renamed a keyword argument required there to strict, which is
clearer. Added it everywhere to be more explicit.
=== Zope3/src/zope/app/browser/form/editview.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.10 Tue Feb 11 10:59:32 2003
+++ Zope3/src/zope/app/browser/form/editview.py Fri Feb 21 09:53:35 2003
@@ -57,7 +57,6 @@
def _setUpWidgets(self):
setUpEditWidgets(self, self.schema, names=self.fieldNames)
-
def setPrefix(self, prefix):
for widget in self.widgets():
@@ -116,7 +115,9 @@
unchanged = True
try:
data = getWidgetsData(self, self.schema,
- required=0, names=self.fieldNames)
+ strict=False,
+ set_missing=True,
+ names=self.fieldNames)
unchanged = self.apply_update(data)
except WidgetsError, errors:
self.errors = errors
=== Zope3/src/zope/app/browser/form/add.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/form/add.py:1.8 Tue Feb 11 10:59:32 2003
+++ Zope3/src/zope/app/browser/form/add.py Fri Feb 21 09:53:35 2003
@@ -94,7 +94,9 @@
if Update in self.request:
try:
data = getWidgetsData(self, self.schema,
- required=0, names=self.fieldNames)
+ strict=False,
+ names=self.fieldNames,
+ set_missing=False)
content = self.apply_update(data)
except WidgetsError, errors:
self.errors = errors