[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Formulator/Fields/Generic - DateTimeField.py:1.1.2.2.2.1 EmailField.py:1.1.2.2.2.1 FileField.py:1.1.2.2.2.1 FloatField.py:1.1.2.2.2.1 IntegerField.py:1.1.2.2.2.1 ListField.py:1.1.2.2.2.1 PasswordField.py:1.1.2.2.2.1 PatternField.py:1.1.2.2.2.1 StringField.py:1.1.2.2.2.1

Stephan Richter srichter@cbu.edu
Fri, 1 Mar 2002 01:57:15 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Formulator/Fields/Generic
In directory cvs.zope.org:/tmp/cvs-serv13304/Fields/Generic

Modified Files:
      Tag: srichter-OFS_Formulator-branch
	DateTimeField.py EmailField.py FileField.py FloatField.py 
	IntegerField.py ListField.py PasswordField.py PatternField.py 
	StringField.py 
Log Message:
Checkin for new Formualtor layout. Much has changed since the initial
checkin:

- Both classes and instances of fields can be used as factory when creating
  views.

- Field: This object is simply a meta-data container for a piece of 
  information; for content objects these are usually its properties.

  Note: It is planned to have a CompositeField for more complex inputs, 
        such as dates.

- FieldViews are virtual objects; they are basically realized Widgets (or 
  Widgets in context)

- Validator: An object that validates data. Note that this object is 
  totally input/protocol-agnostic. Therefore the old concept of some of the
  Zope 2 Formulator validators is not applicable anymore.

- Widget: This is a generic component that is concerned about the 
  presentation of a field in a particular protocol. A difference to the 
  Zope 2 Formulator version is that the widget is also responsible of
  converting possible input-specific representation to a standard one. This
  is not yet fully implemented though.

- Form: A protocol-specific object that is concerned with the overall 
  representation of a form and its action.

- There is a Validator and Field Registry, since Fields and Validators can
  also be used independent of Formulator's goals. Fields should really 
  become the standard way to provide meta-data for properties.

Todo: (too much)

- I need to write a proper metaConfigure.py.

- Make a CompositeField.

- Create XUL Widgets.

- Clean up files.

- Finishing the conversion to the Zope 3 Formulator model.


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/DateTimeField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
-from Zope.App.Formulator.Validators import LinkValidator 
+from Zope.App.Formulator.Field import Field
+from Zope.App.Formulator.Validators import DateTimeValidator 
+# XXX Fix me, once the new DateTime module is being written
 from DateTime import DateTime
 
 
@@ -28,15 +29,15 @@
     default = ''
     title = 'DateTime Field'
     description = 'DateTime Field'
-    validator = Validator.DateTimeValidator()
+    validator = DateTimeValidator.DateTimeValidator()
 
     def __init__(self, id, **kw):
 
         apply(Field.__init__, (self, id), kw)
 
-        if self.get_value('input_style') == 'text':
+        if self.getValue('input_style') == 'text':
             self.sub_form = create_datetime_text_sub_form()
-        elif value == 'list':
+        elif self.getValue('input_style') == 'list':
             self.sub_form = create_datetime_list_sub_form()
         else:
             assert 0, "Unknown input_style"


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/EmailField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import EmailValidator 
 
 
 class EmailField(Field):
 
-    __implements__ = Field.__implements
+    __implements__ = Field.__implements__
 
     id = None
     default = ''
     title = 'Email Field'
     description = 'Email Field'
-    validator = StringValidator.EmailValidator()
+    validator = EmailValidator.EmailValidator()


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/FileField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import FileValidator 
 
 


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/FloatField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import FloatValidator
 
 


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/IntegerField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import IntegerValidator
 
 


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/ListField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import SelectionValidator
 
 


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/PasswordField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import StringValidator
 
 


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/PatternField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import PatternValidator
 
 


=== Zope3/lib/python/Zope/App/Formulator/Fields/Generic/StringField.py 1.1.2.2 => 1.1.2.2.2.1 ===
 """
 
-from Zope.App.Formulator.Fields.Field import Field
+from Zope.App.Formulator.Field import Field
 from Zope.App.Formulator.Validators import StringValidator