Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zopefoundation/z3c.form
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.txt
  • Loading branch information
tdesvenain committed Oct 18, 2013
2 parents c2e07ff + 7e31de1 commit 8b69158
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ benchmark/*.egg-info
.installed.cfg
.tox
bin
coverage
develop-eggs
docs
parts
94 changes: 57 additions & 37 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,117 +2,137 @@
CHANGES
=======

3.0.4 (unreleased)
3.0.6 (unreleased)
------------------

- Added a consistent id on ordered selection widget.

- Fixed a typo in German translations.

3.0.5 (2013-10-09)
------------------

- Bug: Remove errors for cases where the key field of a dict field uses a
sequence widget (most notably choices). The sequence widget always returns
lists as widget values, which are not hashable. We convert those lists to
tuples now within the dict support.


3.0.4 (2013-10-06)
------------------

- Feature: Moved registration of translation directories to a separate ZCML
file.

- Bug: Fixed a typo in German translations.


3.0.3 (2013-09-06)
------------------

- Version 2.9 introduced a solution for missing terms in
- Feature: Version 2.9 introduced a solution for missing terms in
vocabularies. Adapted sources to this solution, too.


3.0.2 (2013-08-14)
------------------

- Fix unicode decode error in weird cases in checkbox.CheckboxWidget.update and radio.RadioWidget.update (eg: when term.value is an Plone Archetype ATFile)
- Bug: Fix unicode decode error in weird cases in
``checkbox.CheckboxWidget.update()`` and ``radio.RadioWidget.update()`` (eg:
when ``term.value`` is an Plone Archetype ATFile)

3.0.1 (2013-06-25)
------------------

- The alpha slipped out as 3.0.0, removed ``ZODB-4.0.0dev.tar.gz``
- Bug: The alpha slipped out as 3.0.0, removed ``ZODB-4.0.0dev.tar.gz``
to reduce damage

- Fixed a bug in ``widget.py`` ``def wrapCSSClass``
- Bug: Fixed a bug in ``widget.py`` ``def wrapCSSClass``


3.0 (2013-06-24)
----------------
3.0.0 (2013-06-24)
------------------

- Only add the 'required' CSS class to widgets when they are in input mode.
- Feature: Added support for ``IDict`` field in ``MultiWidget``.

- Added support for IDict Widget in MultiWidget.
- Bug: Only add the 'required' CSS class to widgets when they are in input mode.

- Catch bug where if a select value was set as from hidden input
or through a rest url as a single value, it won't error out
when trying to remove from ignored list. Probably not the 100%
right fix but it catches core dumps and is sane anyways.
- Bug: Catch bug where if a select value was set as from hidden input or
through a rest url as a single value, it won't error out when trying to
remove from ignored list. Probably not the 100% right fix but it catches
core dumps and is sane anyways.


3.0.0a3 (2013-04-08)
--------------------

- Updated pt_BR translation.
- Feature: Updated pt_BR translation.

- Fixed a bug where file input value was interpeted as UTF-8.
- Bug: Fixed a bug where file input value was interpeted as UTF-8.


3.0.0a2 (2013-02-26)
--------------------

- The 3.0.0a1 release was missing some files (e.g. locales) due to an
incomplete MANIFEST.in.
- Bug: The 3.0.0a1 release was missing some files (e.g. ``locales``) due to an
incomplete ``MANIFEST.in``.


3.0.0a1 (2013-02-24)
--------------------

- Removed several parts to be installed by default, since some packages are
not ported yet.
- Feature: Removed several parts to be installed by default, since some
packages are not ported yet.

- Added support for Python 3.3.
- Feature: Added support for Python 3.3.

- Replaced deprecated ``zope.interface.implements`` usage with equivalent
``zope.interface.implementer`` decorator.
- Feature: Replaced deprecated ``zope.interface.implements`` usage with
equivalent ``zope.interface.implementer`` decorator.

- Dropped support for Python 2.4 and 2.5.
- Feature: Dropped support for Python 2.4 and 2.5.

- Make sure the call to the method that returns the default value
- Bug: Make sure the call to the method that returns the default value
is made with a field which has its context bound.


2.9.1 (2012-11-27)
------------------

- The ``updateWidgets`` method has learned an argument
- Feautre: The ``updateWidgets`` method has received an argument
``prefix`` which allows setting the prefix of the field widgets
adapter.

This allows updating the common widgets prefix before the individual
widgets are updated, useful for situations where neither a form, nor
a widgets prefix is desired.

- Capitalize the messages 'no value' and 'select a value'. This change
- Bug: Capitalize the messages 'no value' and 'select a value'. This change
has been applied also to the existing translations (where applicable).

- ``TextLinesConverter``: do not ignore newlines at the end of the inputted
string, thus do not eat blank items
- Bug: ``TextLinesConverter``: Do not ignore newlines at the end of the
inputted string, thus do not eat blank items

- ``TextLinesConverter``: toFieldValue, convert conversion exceptions to
``FormatterValidationError``, for cases like got a string instead of int
- Bug: ``TextLinesConverter``: ``toFieldValue()``, convert conversion
exceptions to ``FormatterValidationError``, for cases like got a string
instead of int.

2.9.0 (2012-09-17)
------------------

- Missing terms in vocabularies: this was a pain until now.
- Feature: Missing terms in vocabularies: this was a pain until now.
Now it's possible to have the same (missing) value unchanged on the object
with an EditForm after save as it was before editing.
That brings some changes with it:

- *MAJOR*: unchanged values/fields do not get validated anymore
* *MAJOR*: unchanged values/fields do not get validated anymore
(unless they are empty or are FileUploads)
- A temporary ``SimpleTerm`` gets created for the missing value

* A temporary ``SimpleTerm`` gets created for the missing value
Title is by default "Missing: ${value}". See MissingTermsMixin.

- Split ``configure.zcml``
- Feature: Split ``configure.zcml``

- ``SequenceWidget`` DISPLAY_MODE: silently ignore missing tokens,
because INPUT_MODE and HIDDEN_MODE does that too
- Bug: ``SequenceWidget`` DISPLAY_MODE: silently ignore missing tokens,
because INPUT_MODE and HIDDEN_MODE does that too.

2.8.2 (2012-08-17)
------------------
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
from urllib2 import urlopen

# XXX use a more permanent ez_setup.py URL when available.
exec(urlopen('https://bitbucket.org/pypa/setuptools/raw/0.7.2/ez_setup.py'
exec(urlopen('https://bitbucket.org/pypa/setuptools/raw/1.1.6/ez_setup.py'
).read(), ez)
setup_args = dict(to_dir=tmpeggs, download_delay=0)
ez['use_setuptools'](**setup_args)
Expand Down
7 changes: 4 additions & 3 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[buildout]
develop = . benchmark
parts = test coverage-test coverage-report python docs
parts = test coverage-test coverage-report python
; # Parts that do nto build due to the setuptools mess.
; docs
; # Parts with recipes not ported to Python 3.
; test-with-z3cpt
; checker i18n
Expand Down Expand Up @@ -65,13 +67,12 @@ recipe = zc.recipe.egg
eggs =
z3c.coverage
scripts = coveragereport
arguments = ('parts/coverage', 'parts/coverage/report')
arguments = ('${buildout:directory}/coverage', '${buildout:directory}/coverage/report')

[pocompile]
recipe = zc.recipe.egg
eggs = zest.pocompile


[docs]
recipe = z3c.recipe.sphinxdoc
eggs = z3c.form [docs]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def alltests():

setup(
name='z3c.form',
version='3.0.4.dev0',
version='3.0.6.dev0',
author="Stephan Richter, Roger Ineichen and the Zope Community",
author_email="zope-dev@zope.org",
description="An advanced form and widget framework for Zope 3",
Expand Down
3 changes: 1 addition & 2 deletions src/z3c/form/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
<include file="error.zcml" />
<include file="term.zcml" />
<include file="validator.zcml" />
<include file="translation.zcml" />

<include package=".browser" />

<i18n:registerTranslations directory="locales" />

</configure>
5 changes: 5 additions & 0 deletions src/z3c/form/translation.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<configure xmlns="http://namespaces.zope.org/i18n">

<registerTranslations directory="locales" />

</configure>
12 changes: 8 additions & 4 deletions src/z3c/form/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def removeWidgets(self, names):
:param names: list of widget.name to remove from the value
:return: None
"""
zipped = zip(self.key_widgets,self.widgets)
zipped = list(zip(self.key_widgets,self.widgets))
self.key_widgets = [k for k,v in zipped if v.name not in names]
self.widgets = [v for k,v in zipped if v.name not in names]
if self.is_dict:
Expand Down Expand Up @@ -417,17 +417,21 @@ def updateWidgets(self):
self.widgets.append(widget)

if self.is_dict:
# This is needed, since sequence widgets (such as for
# choices) return lists of values.
hash_key = key if not isinstance(key, list) else tuple(key)
widget = self.getWidget(idx, "key", "key_type")
self.applyValue(widget, key)
if key in keys and widget.error is None:
if hash_key in keys and widget.error is None:
error = zope.interface.Invalid(u'Duplicate key')
view = zope.component.getMultiAdapter(
(error, self.request, widget, widget.field,
self.form, self.context), interfaces.IErrorViewSnippet)
self.form, self.context),
interfaces.IErrorViewSnippet)
view.update()
widget.error = view
self.key_widgets.append(widget)
keys.add(key)
keys.add(hash_key)
else:
#makes the template easier to have this the same length
self.key_widgets.append(None)
Expand Down

0 comments on commit 8b69158

Please sign in to comment.