Z3c-form

Latest version: v4.2

Safety actively analyzes 638452 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 11 of 12

1.6.0

Not secure
------------------

- Feature: An event handler for ``ActionErrorOccurred`` events is registered
to merge the action error into the form's error collectors, such as
``form.widgets.errors`` and ``form.widgets['name'].error`` (if
applicable). It also sets the status of the form. (Thanks to Herman
Himmelbauer, who requested the feature, for providing use cases.)

- Feature: Action can now raise ``ActionExecutionError`` exceptions that will
be handled by the framework. These errors wrap the original error. If an
error is specific to a widget, then the widget name is passed to a special
``WidgetActionExecutionError`` error. (Thanks to Herman Himmelbauer, who
requested the feature, for providing use cases.)

- Feature: After an action handler has been executed, an action executed event
is sent to the system. If the execution was successful, the event is
``ActionSuccessfull`` event is sent. If an action execution error was
raised, the ``ActionErrorOccurred`` event is raised. (Thanks to Herman
Himmelbauer, who requested the feature, for providing use cases.)

- Feature: The ``applyChanges()`` function now returns a dictionary of changes
(grouped by interface) instead of a boolean. This allows us to generate a
more detailed object-modified event. If no changes are applied, an empty
dictionary is returned. The new behavior is compatible with the old one, so
no changes to your code are required. (Thanks to Darryl Cousins for the
request and implementation.)

- Feature: A new ``InvalidErrorViewSnippet`` class provides an error view
snippet for ``zope.interface.Invalid`` exceptions, which are frequently used
for invariants.

- Feature: When a widget is required, HTML-based widgets now declare a
"required" class.

- Feature: The validation data wrapper now knows about the context of the
validation, which provides a hook for invariants to access the environment.

- Feature: The BoolTerms term tokens are now cosntants and stay the same, even
if the label has changed. The choice for the token is "true" and "false". By
default it used to be "yes" and "no", so you probably have to change some
unit tests. Functional tests are still okay, because you select by term
title.

- Feature: BoolTerms now expose the labels for the true and false values
to the class. This makes it a matter of doing trivial sub-classing to
change the labels for boolean terms.

- Feature: Exposed several attributes of the widget manager to the form for
convenience. The attributes are: mode, ignoreContext, ignoreRequest,
ignoreReadonly.

- Feature: Provide more user-friendly error messages for number formatting.

- Refactoring: The widget specific class name was in camel-case. A converntion
that later developed uses always dash-based naming of HTML/CSS related
variables. So for example, the class name "textWidget" is now
"text-widget". This change will most likely require some changes to your CSS
declarations!

- Documentation: The text of ``field.txt`` has been reviewed linguistically.

- Documentation: While reviewing the ``form.txt`` with some people, several
unclear and incomplete statements were discovered and fixed.

- Bug (IE): In Internet Explorer, when a label for a radio input field is only
placed around the text describing the choice, then only the text is
surrounded by a dashed box. IE users reported this to be confusing, thus we
now place the label around the text and the input element so that both are
surrounded by the dashed border. In Firefox and KHTML (Safari) only the
radio button is surrounded all the time.

- Bug: When extracting and validating data in the widget manager, invariant
errors were not converted to error view snippets.

- Bug: When error view snippets were not widget-specific -- in other words,
the ``widget`` attribute was ``None`` -- rendering the template would fail.

1.5.0

Not secure
------------------

- Feature: Added a span around values for widgets in display mode. This allows
for easier identification widget values in display mode.

- Feature: Added the concept of widget events and implemented a particular
"after widget update" event that is called right after a widget is updated.

- Feature: Restructured the approach to customize button actions, by requiring
the adapter to provide a new interface ``IButtonAction``. Also, an adapter
is now provided by default, still allowing cusotmization using the usual
methods though.

- Feature: Added button widget. While it is not very useful without
Javascript, it still belongs into this package for completion.

- Feature: All ``IFieldWidget`` instances that are also HTML element widgets
now declare an additional CSS class of the form "<fieldtype.lower()>-field".

- Feature: Added ``addClass()`` method to HTML element widgets, so that adding
a new CSS class is simpler.

- Feature: Renamed "css" attribute of the widget to "klass", because the class
of an HTML element is a classification, not a CSS marker.

- Feature: Reviewed all widget attributes. Added all available HTML attributes
to the widgets.

- Documentation: Removed mentioning of widget's "hint" attribute, since it
does not exist.

- Optimization: The terms for a sequence widget were looked up multiple times
among different components. The widget is now the canonical source for the
terms and other components, such as the converter uses them. This avoids
looking up the terms multiple times, which can be an expensive process for
some applications.

- Bug/Feature: Correctly create labels for radio button choices.

- Bug: Buttons did not honor the name given by the schema, if created within
one, because we were too anxious to give buttons a name. Now name assignment
is delayed until the button is added to the button manager.

- Bug: Button actions were never updated in the actions manager.

- Bug: Added tests for textarea widget.

1.4.0

Not secure
------------------

- Feature: The select widget grew a new ``prompt`` flag, which allows you to
explicitely request a selection prompt as the first option in the selection
(even for required fields). When set, the prompt message is shown. Such a
prompt as option is common in Web-UIs.

- Feature: Allow "no value message" of select widgets to be dynamically
changed using an attribute value adapter.

- Feature: Internationalized data conversion for date, time, date/time,
integer, float and decimal. Now the locale data is used to format and parse
those data types to provide the bridge to text-based widgets. While those
features require the latest zope.i18n package, backward compatibility is
provided.

- Feature: All forms now have an optional label that can be used by the UI.

- Feature: Implemented groups within forms. Groups allow you to combine a set
of fields/widgets into a logical unit. They were designed with ease of use
in mind.

- Feature: Button Actions -- in other words, the widget for the button field
-- can now be specified either as the "actionFactory" on the button field or
as an adapter.

- Bug: Recorded all public select-widget attributes in the interface.

1.3.0

Not secure
------------------

- Feature: In an edit form applying the data and generating all necessary
messages was all done within the "Apply" button handler. Now the actual task
of storing is factored out into a new method called "applyChanges(data)",
which returns whether the data has been changed. This is useful for forms
not dealing with objects.

- Feature: Added support for ``hidden`` fields. You can now use the ``hidden``
mode for widgets which should get rendered as ``<input type="hidden"
/>``.

Note: Make sure you use the new formui templates which will avoid rendering
labels for hidden widgets or adjust your custom form macros.

- Feature: Added ``missing_value`` support to data/time converters

- Feature: Added named vocabulary lookup in ``ChoiceTerms`` and
``CollectionTerms``.

- Feature: Implemented support for ``FileUpload`` in ``FileWidget``.

* Added helper for handling ``FileUpload`` widgets:

+ ``extractContentType(form, id)``

Extracts the content type if ``IBytes``/``IFileWidget`` was used.

+ ``extractFileName(form, id, cleanup=True, allowEmtpyPostFix=False)``

Extracts a filename if ``IBytes``/``IFileWidget`` was used.

Uploads from win/IE need some cleanup because the filename includes also
the path. The option ``cleanup=True`` will do this for you. The option
``allowEmtpyPostFix`` allows you to pass a filename without
extensions. By default this option is set to ``False`` and will raise a
``ValueError`` if a filename doesn't contain an extension.

* Created afile upload data converter registered for
``IBytes``/``IFileWidget`` ensuring that the converter will only be used
for fiel widgets. The file widget is now the default for the bytes
field. If you need to use a text area widget for ``IBytes``, you have to
register a custom widget in the form using::

fields['foobar'].widgetFactory = TextWidget

- Feature: Originally, when an attribute access failed in Unauthorized or
ForbiddenAttribute exceptions, they were ignored as if the attribute would
have no value. Now those errors are propagated and the system will fail
providing the developer with more feedback. The datamanager also grew a new
``query()`` method that returns always a default and the ``get()`` method
propagates any exceptions.

- Feature: When writing to a field is forbidden due to insufficient
priviledges, the resulting widget mode will be set to "display". This
behavior can be overridden by explicitely specifying the mode on a field.

- Feature: Added an add form implementation against ``IAdding``. While this is
not an encouraged method of adding components, many people still use this
API to extend the ZMI.

- Feature: The ``IFields`` class' ``select()`` and ``omit()`` method now
support two ketword arguments "prefix" and "interface" that allow the
selection and omission of prefixed fields and still specify the short
name. Thanks to Nikolay Kim for the idea.

- Feature: HTML element ids containing dots are not very good, because then
the "elementid" CSS selector does not work and at least in Firefox the
attribute selector ("element[attr=value]") does not work for the id
either. Converted the codebase to use dashes in ids instead.

- Bug/Feature: The ``IWidgets`` component is now an adapter of the form
content and not the form context. This guarantees that vocabulary factories
receive a context that is actually useful.

- Bug: The readonly flag within a field was never honored. When a field is
readonly, it is displayed in "display" mode now. This can be overridden by
the widget manager's "ignoreReadonly" flag, which is necessary for add
forms.

- Bug: The mode selection made during the field layout creation was not
honored and the widget manager always overrode the options providing its
value. Now the mode specified in the field is more important than the one
from the widget manager.

- Bug: It sometimes happens that the sequence widget has the no-value token as
one element. This caused ``displayValue()`` to fail, since it tried to find
a term for it. For now we simply ignore the no-value token.

- Bug: Fixed the converter when the incoming value is an empty string. An
empty string really means that we have no value and it is thus missing,
returning the missing value.

- Bug: Fix a slightly incorrect implementation. It did not cause any harm in
real-world forms, but made unit testing much harder, since an API
expectation was not met correctly.

- Bug: When required selections where not selected in radio and checkbox
widgets, then the conversion did not behave correctly. This also revealed
some issues with the converter code that have been fixed now.

- Bug: When fields only had a vocabulary name, the choice terms adaptation
would fail, since the field was not bound. This has now been corrected.

- Documentation: Integrated English language and content review improvements
by Roy Mathew in ``form.txt``.

1.2.0

Not secure
------------------

- Feature: Added ability to change the button action title using an ``IValue``
adapter.

1.1.0

Not secure
------------------

- Feature: Added compatibility for Zope 3.3 and thus Zope 2.10.

Page 11 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.