[Checkins] SVN: z3c.form/trunk/src/z3c/form/group.txt changed Int to TextLine, this was only working because there was no IntegerDataConverter configured and the FieldDataConverter was used.

Roger Ineichen roger at projekt01.ch
Wed Oct 1 01:05:34 EDT 2008


Log message for revision 91644:
  changed Int to TextLine, this was only working because there was no IntegerDataConverter configured and the FieldDataConverter was used.
  The correct output for year as int whould be 2,005 and not 2005

Changed:
  U   z3c.form/trunk/src/z3c/form/group.txt

-=-
Modified: z3c.form/trunk/src/z3c/form/group.txt
===================================================================
--- z3c.form/trunk/src/z3c/form/group.txt	2008-10-01 00:43:54 UTC (rev 91643)
+++ z3c.form/trunk/src/z3c/form/group.txt	2008-10-01 05:05:33 UTC (rev 91644)
@@ -26,7 +26,7 @@
   ...
   ...     model = zope.schema.TextLine(title=u'Model')
   ...     make = zope.schema.TextLine(title=u'Make')
-  ...     year = zope.schema.Int(title=u'Year')
+  ...     year = zope.schema.TextLine(title=u'Year')
 
   >>> class VehicleRegistration(object):
   ...     zope.interface.implements(IVehicleRegistration)
@@ -161,7 +161,7 @@
             <label for="form-widgets-year">Year</label>
             <input type="text" id="form-widgets-year"
                    name="form.widgets.year"
-                   class="text-widget required int-field"
+                   class="text-widget required textline-field"
                    value="" />
           </div>
         </fieldset>
@@ -272,7 +272,7 @@
   >>> reg.make
   u'325'
   >>> reg.year
-  2005
+  u'2005'
 
 Let's now have a look at an edit form for the vehicle registration:
 
@@ -346,7 +346,7 @@
             <label for="form-widgets-year">Year</label>
             <input type="text" id="form-widgets-year"
                    name="form.widgets.year"
-                   class="text-widget required int-field"
+                   class="text-widget required textline-field"
                    value="2005" />
           </div>
         </fieldset>
@@ -439,7 +439,7 @@
   >>> reg.make
   u'F150'
   >>> reg.year
-  2006
+  u'2006'
 
 Let's look at the event:
  
@@ -484,7 +484,7 @@
   ...
   ...     model = zope.schema.TextLine(title=u'Model')
   ...     make = zope.schema.TextLine(title=u'Make')
-  ...     year = zope.schema.Int(title=u'Year')
+  ...     year = zope.schema.TextLine(title=u'Year')
 
 Now let's create simple implementations of these two interfaces.
 
@@ -577,7 +577,7 @@
           <label for="form-widgets-year">Year</label>
           <input type="text" id="form-widgets-year"
                  name="form.widgets.year"
-                 class="text-widget required int-field" value="2005" />
+                 class="text-widget required textline-field" value="2005" />
         </div>
         <fieldset>
           <legend>Owner</legend>
@@ -641,6 +641,6 @@
   >>> reg.make
   u'325'
   >>> reg.year
-  2005
+  u'2005'
 
 And that's it!



More information about the Checkins mailing list