[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - add.py:1.6.2.1 editview.py:1.8.2.1 widget.py:1.10.2.1

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:42:01 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv18615/src/zope/app/browser/form

Modified Files:
      Tag: paris-copypasterename-branch
	add.py editview.py widget.py 
Log Message:
Updating from HEAD to make sure everything still works before merging

=== Zope3/src/zope/app/browser/form/add.py 1.6 => 1.6.2.1 ===
--- Zope3/src/zope/app/browser/form/add.py:1.6	Mon Jan 27 20:50:14 2003
+++ Zope3/src/zope/app/browser/form/add.py	Tue Feb 11 09:41:00 2003
@@ -40,8 +40,7 @@
     to be edited.
     """
 
-    def __init__(self, context, request):
-        super(EditView, self).__init__(context, request)
+    def _setUpWidgets(self):
         setUpWidgets(self, self.schema, names=self.fieldNames)
 
     def apply_update(self, data):
@@ -193,7 +192,7 @@
 
     return [
         Action(
-        discriminator = ('http://namespaces.zope.org/form/add', name, layer),
+        discriminator = ('view', IAdding, name, IBrowserPresentation, layer),
         callable = AddViewFactory,
         args = (name, schema, label, permission, layer, template, 'add.pt',
                 bases,


=== Zope3/src/zope/app/browser/form/editview.py 1.8 => 1.8.2.1 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.8	Mon Jan 27 23:57:30 2003
+++ Zope3/src/zope/app/browser/form/editview.py	Tue Feb 11 09:41:00 2003
@@ -53,7 +53,11 @@
 
     def __init__(self, context, request):
         super(EditView, self).__init__(context, request)
+        self._setUpWidgets()
+
+    def _setUpWidgets(self):
         setUpEditWidgets(self, self.schema, names=self.fieldNames)
+        
 
     def setPrefix(self, prefix):
         for widget in self.widgets():
@@ -221,8 +225,7 @@
 
     actions.append(
         Action(
-        discriminator = ('http://namespaces.zope.org/form/edit',
-                         name, for_, layer),
+        discriminator = ('view', for_, name, IBrowserPresentation, layer),
         callable = EditViewFactory,
         args = (name, schema, label, permission, layer, template, 'edit.pt',
                 bases,
@@ -244,8 +247,7 @@
 
     return [
         Action(
-        discriminator = ('http://namespaces.zope.org/form/subedit',
-                         name, for_, layer),
+        discriminator = ('view', for_, name, IBrowserPresentation, layer),
         callable = EditViewFactory,
         args = (name, schema, label, permission, layer, template, 'subedit.pt',
                 bases,


=== Zope3/src/zope/app/browser/form/widget.py 1.10 => 1.10.2.1 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.10	Mon Jan 20 11:23:37 2003
+++ Zope3/src/zope/app/browser/form/widget.py	Tue Feb 11 09:41:00 2003
@@ -59,7 +59,7 @@
             return field.default
 
         value = self._convert(value)
-        if value is not None or not optional:
+        if value is not None and not optional:
 
             try:
                 field.validate(value)
@@ -200,7 +200,9 @@
     displayWidth = 20
     displayMaxWidth = ""
     extra = ''
-    style = "width:100%"
+    # XXX Alex Limi doesn't like this!
+    # style = "width:100%"
+    style = ''
     __values = None
 
     def _convert(self, value):
@@ -321,7 +323,8 @@
     width = 60
     height = 15
     extra=""
-    style="width:100%"
+    #style="width:100%"
+    style = ''
 
     def _convert(self, value):
         if self.context.min_length and not value:
@@ -635,6 +638,11 @@
         if kw['cssClass'] != "":
             attr_list.append('class="%s"' % kw['cssClass'])
         del kw['cssClass']
+
+    if 'style' in kw:
+        if kw['style'] != '':
+            attr_list.append('style="%s"' % kw['style'])
+        del kw['style']
 
     # special case handling for extra 'raw' code
     if 'extra' in kw: