Z3c.form

Latest version: v5.1

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

Scan your dependencies

Page 12 of 12

1.3.0

------------------

- 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

------------------

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

1.1.0

------------------

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

1.0.0

------------------

- Initial Release

Page 12 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.