Skip to content

Commit

Permalink
- Grouped features, refactorings and fixed bugs in change log
Browse files Browse the repository at this point in the history
- fixed headlines in term.txt (this fixes the warning produced by `bin/docs`)
  • Loading branch information
Michael Howitz committed May 17, 2009
1 parent 2f736c3 commit b145b11
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 55 deletions.
83 changes: 46 additions & 37 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,123 +5,132 @@ CHANGES
Version 2.0.0 (unreleased)
--------------------------

- Feature: Added nested group support. Groups are rendered as fieldsets.
Features
~~~~~~~~

- Added nested group support. Groups are rendered as fieldsets.
Nested fieldsets are very useful when designing forms.

- Feature: Added `labelRequired` and `requiredInfo` form attributes. This is
- Added `labelRequired` and `requiredInfo` form attributes. This is
useful for conditional rendering a required info legend in form templates.
The `requiredInfo` label depends by default on a given `labelRequired`
message id and will only return the label if at least one widget field is
required.

- Feature: Add support for refreshing actions after their execution. This is
- Add support for refreshing actions after their execution. This is
useful when button action conditions are changing as a result of action
execution. All you need is to set the `refreshActions` flag of the form to
`True` in your action handler.

- Feature: Added support for using sources. Where is was previosly possible to
- Added support for using sources. Where is was previosly possible to
use a vocabulary it is now also possible to use a source. This works both
for basic and contextual sources.

IMPORTANT: The `ChoiceTerms` and `CollectionTerms` in `z3c.form.term` are
**IMPORTANT:** The `ChoiceTerms` and `CollectionTerms` in `z3c.form.term` are
now simple functions that query for real `ITerms` adapters for field's
`source` or `value_type` respectively. So if your code inherits the old
`ChoiceTerms` and `CollectionTerms` classes, you'll need to review and adapt
it. See the `z3c.form.term` package and its documentation.

- Feature: The new `z3c.form.interfaces.NOT_CHANGED` special value is
- The new `z3c.form.interfaces.NOT_CHANGED` special value is
available to signal that the current value should be left as is. It's
currently handled in the `z3c.form.form.applyChanges` function.

- Feature: When no file is specified in the file upload widget, instead of
- When no file is specified in the file upload widget, instead of
overwriting the value with a missing one, the old data is retained.
This is done by returning the new `NOT_CHANGED` special value from the
`FileUploadDataConvereter`.

- Feature: Preliminary support for widgets for the `schema.IObject` field has
- Preliminary support for widgets for the `schema.IObject` field has
been added. However, there is a big caveat, please read the
``object-caveat.txt`` document inside the package.

A new `objectWidgetTemplate` ZCML directive is provided to register widget
templates for specific object field schemas.

- Feature: Implemented the `MultiWidget` widget. This widget allows to use
- Implemented the `MultiWidget` widget. This widget allows to use
simple fields like `ITextLine`, `IInt`, `IPassword`, etc. in a `IList` or
`ITuple` sequence.

- Feature: Implemented `TextLinesWidget` widget. This widget offers a text
- Implemented `TextLinesWidget` widget. This widget offers a text
area element and splits lines in sequence items. This is usfull for power
user interfaces. The widget can be used for sequence fields (e.g. `IList`)
that specify a simple value type field (e.g. `ITextLine` or `IInt`).

- Feature: Added a new flag `ignoreContext` to the form field, so that one can
- Added a new flag `ignoreContext` to the form field, so that one can
individually select which fields should and which ones should not ignore the
context.

- Feature: Allow raw request values of sequence widgets to be non-sequence
- Allow raw request values of sequence widgets to be non-sequence
values, which makes integration with Javascript libraries easier.

- Feature: Added support in the file upload widget's testing flavor to specify
- Added support in the file upload widget's testing flavor to specify
'base64'-encoded strings in the hidden text area, so that binary data can be
uploaded as well.

- Feature: Allow overriding the `required` widget attribute using `IValue`
- Allow overriding the `required` widget attribute using `IValue`
adapter just like it's done for `label` and `name` attributes.

- Feature: Add the `prompt` attribute of the `SequenceWidget` to the list of
- Add the `prompt` attribute of the `SequenceWidget` to the list of
adaptable attributes.

- Feature: Added benchmarking suite demonstrating performance gain
when using ``z3c.pt``.

- Feature: Added support for ``z3c.pt``. Usage is switched on via the
- Added support for ``z3c.pt``. Usage is switched on via the
"PREFER_Z3C_PT" environment variable.

- Feature: The `TypeError` message used when a field does not provide
- The `TypeError` message used when a field does not provide
`IFormUnicode` now also contains the type of the field.

- Feature: Add support for internationalization of `z3c.form` messages.
- Add support for internationalization of `z3c.form` messages.
Added Russian, French, German and Chinese translations.

- Feature: Sphinx documentation for the package can now be created using the
- Sphinx documentation for the package can now be created using the
new `docs` script.

- Feature: The widget for fields implementing `IChoice` is now looked up by
- The widget for fields implementing `IChoice` is now looked up by
querying for an adapter for ``(field, field.vocabulary, request)`` so it can
be differentiated according to the type of the source used for the field.

- Feature: move `formErrorsMessage` attribute from `AddForm` and `EditForm` to
- move `formErrorsMessage` attribute from `AddForm` and `EditForm` to
the `z3c.form.form.Form` base class as it's very common validation status
message and can be easily reused (especially when translations are
provided).

- Refactoring: Removed compatibility support with Zope 3.3.
Refactoring
~~~~~~~~~~~

- Removed compatibility support with Zope 3.3.

- Refactoring: Templates now declare XML namespaces.
- Templates now declare XML namespaces.

- Refactoring: HTML output is now compared using a modified version of
- HTML output is now compared using a modified version of
the XML-aware output checker provided by `lxml`.

- Refactoring: Remove unused imports, adjust buildout dependencies in
- Remove unused imports, adjust buildout dependencies in
`setup.py`.

- Refactoring: Use the `z3c.ptcompat` template engine compatibility layer.
- Use the `z3c.ptcompat` template engine compatibility layer.

Fixed Bugs
~~~~~~~~~~

- Bug: IMPORTANT - The signature of `z3c.form.util.extractFileName` function
- **IMPORTANT** - The signature of `z3c.form.util.extractFileName` function
changed because of spelling mistake fix in argument name. The
`allowEmtpyPostFix` is now called `allowEmptyPostfix` (note `Empty`
instead of `Emtpy` and `Postfix` instead of `PostFix`).

- Bug: IMPORTANT - The `z3c.form.interfaces.NOVALUE` special value has been
- **IMPORTANT** - The `z3c.form.interfaces.NOVALUE` special value has been
renamed to `z3c.form.interfaces.NO_VALUE` to follow the common naming
style. The backward-compatibility `NOVALUE` name is still in place, but the
`repr` output of the object has been also changed, thus it may break your
doctests.

- Bug: When dealing with `Bytes` fields, we should do a null conversion
- When dealing with `Bytes` fields, we should do a null conversion
when going to its widget value.

- Bug: `FieldWidgets` update method were appending keys and values within each
- `FieldWidgets` update method were appending keys and values within each
update call. Now the `util.Manager` uses a `UniqueOrderedKeys`
implementation which will ensure that we can't add duplicated manager
keys. The implementation also ensures that we can't override the
Expand All @@ -130,27 +139,27 @@ Version 2.0.0 (unreleased)
probably use a customized `UserList` implementation. Now we can call
``widgets.update()`` more then one time without any side effect.

- Bug: `ButtonActions` update where appending keys and values within each
- `ButtonActions` update where appending keys and values within each
update call. Now we can call ``actions.update()`` more then one time without
any side effect.

- Bug: The `CollectionSequenceDataConverter` no longer throws a
- The `CollectionSequenceDataConverter` no longer throws a
``TypeError: 'NoneType' object is not iterable`` when passed the value
of a non-required field (which in the case of a `List` field is `None`).

- Bug: The `SequenceDataConverter` and `CollectionSequenceDataConverter`
- The `SequenceDataConverter` and `CollectionSequenceDataConverter`
converter classes now ignore values that are not present in the terms when
converting to a widget value.

- Bug: Use ``nocall:`` modifier in `orderedselect_input.pt` to avoid calling
- Use ``nocall:`` modifier in `orderedselect_input.pt` to avoid calling
list entry if it is callable.

- Bug: `SingleCheckBoxFieldWidget` doesn't repeat the label twice (once in
- `SingleCheckBoxFieldWidget` doesn't repeat the label twice (once in
``<div class="label">``, and once in the ``<label>`` next to the checkbox).

- Bug: Don't cause warnings in Python 2.6.
- Don't cause warnings in Python 2.6.

- Bug: `validator.SimpleFieldValidator` is now able to handle
- `validator.SimpleFieldValidator` is now able to handle
`interfaces.NOT_CHANGED`. This value is set for file uploads when
the user does not choose a file for upload.

Expand Down
36 changes: 18 additions & 18 deletions src/z3c/form/term.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ needing them. Since Zope 3 already has sources and vocabularies, the base
terms class simply builds on them.

Vocabularies
============
------------

Thus, let's create a vocabulary first:

Expand All @@ -19,7 +19,7 @@ Thus, let's create a vocabulary first:
... ])

Terms
-----
~~~~~

Now we can create the terms object:

Expand Down Expand Up @@ -79,7 +79,7 @@ fields. Within the framework, terms are used as adapters with the follwoing
discriminators: context, request, form, field, vocabulary/source and widget.

Choice field
============
~~~~~~~~~~~~

The first terms implementation is for ``Choice`` fields. Choice fields
unfortunately can have a vocabulary and a source which behave differently.
Expand Down Expand Up @@ -135,7 +135,7 @@ We should now be able to get all terms as before:
[u'bad', u'okay', u'good']

Bool fields
-----------
+++++++++++

A similar terms implementation exists for a ``Bool`` field:

Expand All @@ -157,7 +157,7 @@ can subclass the ``BoolTerms`` class to control the display labels.
[u'True', u'False']

Collections
-----------
+++++++++++

Finally, there are a terms adapters for all collections. But we have to
register some adapters before using it:
Expand All @@ -178,15 +178,15 @@ register some adapters before using it:


Sources
=======
-------

Basic sources
-------------
~~~~~~~~~~~~~

Basic sources need no context to compute their value. Let's create a
source first:

>>> from zc.sourcefactory.basic import BasicSourceFactory
>>> from zc.sourcefactory.basic import BasicSourceFactory
>>> class RatingSourceFactory(BasicSourceFactory):
... _mapping = {10: u'ugly', 20: u'nice', 30: u'great'}
... def getValues(self):
Expand All @@ -208,7 +208,7 @@ ChoiceTermsSource adapter:
>>> zope.component.provideAdapter(term.ChoiceTermsSource)

Choice fields
~~~~~~~~~~~~~
+++++++++++++

Sources can be used with ``Choice`` fields like vocabularies. First
we create a field based on the source:
Expand All @@ -227,7 +227,7 @@ Iterating over the terms adapter returnes the term objects:

>>> [entry for entry in terms]
[<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>,
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>,
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>,
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>]
>>> len(terms)
3
Expand All @@ -248,10 +248,10 @@ With can test if a value is in the source:
>>> 30 in terms
True
>>> 25 in terms
False
False

Collections
~~~~~~~~~~~
+++++++++++

Finally, there are terms adapters for all collections:

Expand All @@ -266,14 +266,14 @@ Finally, there are terms adapters for all collections:


Contextual sources
------------------
~~~~~~~~~~~~~~~~~~

Contextual sources depend on the context they are called on. Let's
create a context and a contextual source:

>>> from zc.sourcefactory.contextual import BasicContextualSourceFactory
>>> class RatingContext(object):
... base_value = 10
... base_value = 10
>>> class ContextualRatingSourceFactory(BasicContextualSourceFactory):
... _mapping = {10: u'ugly', 20: u'nice', 30: u'great'}
... def getValues(self, context):
Expand All @@ -295,7 +295,7 @@ ChoiceTermsSource adapter:
>>> zope.component.provideAdapter(term.ChoiceTermsSource)

Choice fields
~~~~~~~~~~~~~
+++++++++++++

Contextual sources can be used with ``Choice`` fields like
vocabularies. First we create a field based on the source:
Expand All @@ -316,7 +316,7 @@ Iterating over the terms adapter returnes the term objects:

>>> [entry for entry in terms]
[<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>,
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>,
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>,
<zc.sourcefactory.browser.source.FactoredTerm object at 0x...>]
>>> len(terms)
3
Expand All @@ -337,10 +337,10 @@ With can test if a value is in the source:
>>> 130 in terms
True
>>> 125 in terms
False
False

Collections
~~~~~~~~~~~
+++++++++++

Finally, there are terms adapters for all collections:

Expand Down

0 comments on commit b145b11

Please sign in to comment.