[Checkins] SVN: z3c.form/branches/adamg-objectwidget/src/z3c/form/hint. spelling and whitespace.
Paul Carduner
paulcarduner at gmail.com
Tue Oct 28 01:31:55 EDT 2008
Log message for revision 92649:
spelling and whitespace.
Changed:
U z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.py
U z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.txt
-=-
Modified: z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.py
===================================================================
--- z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.py 2008-10-28 05:28:07 UTC (rev 92648)
+++ z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.py 2008-10-28 05:31:55 UTC (rev 92649)
@@ -29,7 +29,7 @@
zope.interface.implements(interfaces.IValue)
zope.component.adapts(zope.interface.Interface, interfaces.IFormLayer,
- interfaces.IForm, zope.schema.interfaces.IField, interfaces.IWidget)
+ interfaces.IForm, zope.schema.interfaces.IField, interfaces.IWidget)
def __init__(self, context, request, form, field, widget):
self.context = context
Modified: z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.txt
===================================================================
--- z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.txt 2008-10-28 05:28:07 UTC (rev 92648)
+++ z3c.form/branches/adamg-objectwidget/src/z3c/form/hint.txt 2008-10-28 05:31:55 UTC (rev 92649)
@@ -1,16 +1,17 @@
-========================
+=====================
Hint (title) Adapters
-========================
+=====================
-A widget can provide a hint. Hints are not a standard concept, the
-implementations can be very different in each project. Hints are most the time
-implemented with JavaScript since the default ``input title`` hint in browsers
-ar almost unusable.
+A widget can provide a hint. Hints are not a standard concept, the
+implementations can be very different in each project. Hints are most
+of the time implemented with JavaScript since the default ``input
+title`` hint in browsers are almost unusable.
-Our hint support is limited and only offers some helpers. Which means we will
-offer an adapter for show the schema field description as title. Since this
-is very specific we only provide a ``FieldDescriptionAsHint`` adapter which
-you can configure as named IValue adapter.
+Our hint support is limited and only offers some helpers. Which means
+we will offer an adapter that shows the schema field description as
+the title. Since this is very specific we only provide a
+``FieldDescriptionAsHint`` adapter which you can configure as a named
+IValue adapter.
>>> import zope.interface
>>> import zope.component
@@ -26,16 +27,16 @@
Let's create a couple of simple widgets and forms first:
>>> class IContent(zope.interface.Interface):
- ...
+ ...
... textLine = zope.schema.TextLine(
... title=u'Title',
... description=u'A TextLine description')
>>> class Content(object):
... zope.interface.implements(IContent)
- ...
+ ...
... textLine = None
- ...
+ ...
>>> content = Content()
>>> from z3c.form.testing import TestRequest
@@ -75,14 +76,15 @@
Check all fields
----------------
-Just make sure that all widgets get correct handled. This sample can be useful
-if you need to implement a JavaScript based hint concept:
+Just to make sure that all the widgets are handled correctly, we will
+go trhough each of them. This sample can be useful if you need to
+implement a JavaScript based hint concept:
>>> import datetime
>>> import decimal
>>> from zope.schema import vocabulary
-Let's setup a sample vocabulary:
+Let's setup a simple vocabulary:
>>> vocab = vocabulary.SimpleVocabulary([
... vocabulary.SimpleVocabulary.createTerm(1, '1', u'One'),
@@ -93,145 +95,145 @@
... ])
>>> class IAllInOne(zope.interface.Interface):
- ...
+ ...
... asciiField = zope.schema.ASCII(
... title=u'ASCII',
... description=u'This is an ASCII field.',
... default='This is\n ASCII.')
- ...
+ ...
... asciiLineField = zope.schema.ASCIILine(
... title=u'ASCII Line',
... description=u'This is an ASCII-Line field.',
... default='An ASCII line.')
- ...
+ ...
... boolField = zope.schema.Bool(
... title=u'Boolean',
... description=u'This is a Bool field.',
... default=True)
- ...
+ ...
... checkboxBoolField = zope.schema.Bool(
... title=u'Boolean (Checkbox)',
... description=u'This is a Bool field displayed suing a checkbox.',
... default=True)
- ...
+ ...
... bytesLineField = zope.schema.BytesLine(
... title=u'Bytes Line',
... description=u'This is a bytes line field.',
... default='A Bytes line.')
- ...
+ ...
... choiceField = zope.schema.Choice(
... title=u'Choice',
... description=u'This is a choice field.',
... default=3,
... vocabulary=vocab)
- ...
+ ...
... optionalChoiceField = zope.schema.Choice(
... title=u'Choice (Not Required)',
... description=u'This is a non-required choice field.',
... vocabulary=vocab,
... required=False)
- ...
+ ...
... promptChoiceField = zope.schema.Choice(
... title=u'Choice (Explicit Prompt)',
... description=u'This is a choice field with an explicit prompt.',
... vocabulary=vocab,
... required=False)
- ...
+ ...
... dateField = zope.schema.Date(
... title=u'Date',
... description=u'This is a Date field.',
... default=datetime.date(2007, 4, 1))
- ...
+ ...
... datetimeField = zope.schema.Datetime(
... title=u'Date/Time',
... description=u'This is a Datetime field.',
... default=datetime.datetime(2007, 4, 1, 12))
- ...
+ ...
... decimalField = zope.schema.Decimal(
... title=u'Decimal',
... description=u'This is a Decimal field.',
... default=decimal.Decimal('12.87'))
- ...
+ ...
... dottedNameField = zope.schema.DottedName(
... title=u'Dotted Name',
... description=u'This is a DottedName field.',
... default='z3c.form')
- ...
+ ...
... floatField = zope.schema.Float(
... title=u'Float',
... description=u'This is a Float field.',
... default=12.8)
- ...
+ ...
... frozenSetField = zope.schema.FrozenSet(
... title=u'Frozen Set',
... description=u'This is a FrozenSet field.',
... value_type=choiceField,
... default=frozenset([1, 3]) )
- ...
+ ...
... idField = zope.schema.Id(
... title=u'Id',
... description=u'This is a Id field.',
... default='z3c.form')
- ...
+ ...
... intField = zope.schema.Int(
... title=u'Integer',
... description=u'This is a Int field.',
... default=12345)
- ...
+ ...
... listField = zope.schema.List(
... title=u'List',
... description=u'This is a List field.',
... value_type=choiceField,
... default=[1, 3])
- ...
+ ...
... passwordField = zope.schema.Password(
... title=u'Password',
... description=u'This is a Password field.',
... default=u'mypwd',
... required=False)
- ...
+ ...
... setField = zope.schema.Set(
... title=u'Set',
... description=u'This is a Set field.',
... value_type=choiceField,
... default=set([1, 3]) )
- ...
+ ...
... sourceTextField = zope.schema.SourceText(
... title=u'Source Text',
... description=u'This is a SourceText field.',
... default=u'<source />')
- ...
+ ...
... textField = zope.schema.Text(
... title=u'Text',
... description=u'This is a Text field.',
... default=u'Some\n Text.')
- ...
+ ...
... textLineField = zope.schema.TextLine(
... title=u'Text Line',
... description=u'This is a TextLine field.',
... default=u'Some Text line.')
- ...
+ ...
... timeField = zope.schema.Time(
... title=u'Time',
... description=u'This is a Time field.',
... default=datetime.time(12, 0))
- ...
+ ...
... timedeltaField = zope.schema.Timedelta(
... title=u'Time Delta',
... description=u'This is a Timedelta field.',
... default=datetime.timedelta(days=3))
- ...
+ ...
... tupleField = zope.schema.Tuple(
... title=u'Tuple',
... description=u'This is a Tuple field.',
... value_type=choiceField,
... default=(1, 3))
- ...
+ ...
... uriField = zope.schema.URI(
... title=u'URI',
... description=u'This is a URI field.',
... default='http://zope.org')
- ...
+ ...
... hiddenField = zope.schema.TextLine(
... title=u'Hidden Text Line',
... description=u'This is a hidden TextLine field.',
@@ -239,7 +241,7 @@
>>> class AllInOne(object):
... zope.interface.implements(IAllInOne)
- ...
+ ...
... asciiField = None
... asciiLineField = None
... boolField = None
@@ -561,7 +563,7 @@
class="text-widget required time-field"
title="This is a Time field." value="12:00"
type="text" />
-
+
>>> print allInOneForm.widgets['timedeltaField'].render()
<input id="form-widgets-timedeltaField"
name="form.widgets.timedeltaField"
More information about the Checkins
mailing list