Skip to content

Commit

Permalink
Merge branch 'master' into remove-object-subform
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens authored Feb 6, 2017
2 parents 02aab2a + 6d92326 commit 68e84fa
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
28 changes: 25 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Changelog
=========

2.2 (unreleased)
----------------
2.2.1 (unreleased)
------------------

Breaking changes:

Expand All @@ -23,7 +23,29 @@ New features:

Bug fixes:

- *add item here*
- remove deprecated __of__ for browserviews
[pbauer]


2.2 (2017-01-02)
----------------

Breaking changes:

- Test fixes for plone.app.widgets 2.1.
While this is not a breaking change functionality or API wise, the tests do only pass with plone.app.widgets 2.1.
[thet]

Bug fixes:

- Fix RelatedItemsDataConverter with relation lists, where in an iteration a wrong value was checked to be existent.
Fixes failures in situations, where a ``None`` value was part of the relation list.
[thet]

- Fix RelatedItemsDataConverter with choice lists, where choices are UUID
strings of selected relations, but conversion failed, because Choice
field has None as its value_type
[datakurre]


2.1.2 (2016-12-02)
Expand Down
4 changes: 3 additions & 1 deletion plone/app/z3cform/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def toWidgetValue(self, value):
return self.field.missing_value
separator = getattr(self.widget, 'separator', ';')
if IRelationList.providedBy(self.field):
return separator.join([IUUID(o) for o in value if value])
return separator.join([IUUID(o) for o in value if o])
else:
return separator.join(v for v in value if v)

Expand Down Expand Up @@ -265,6 +265,8 @@ def toFieldValue(self, value):
if uid in objects.keys())
else:
valueType = getattr(self.field.value_type, '_type', unicode)
if valueType is None:
valueType = unicode
return collectionType(valueType(v) for v in value)


Expand Down
2 changes: 1 addition & 1 deletion plone/app/z3cform/inline_validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Let's verify that worked:
... def restrictedTraverse(self, name):
... # fake traversal to the form
... if name.startswith('@@'):
... return getMultiAdapter((self, self._REQUEST), Interface, name[2:]).__of__(self)
... return getMultiAdapter((self, self._REQUEST), Interface, name[2:])
... else:
... return getattr(self, name)
...
Expand Down
2 changes: 1 addition & 1 deletion plone/app/z3cform/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from plone.app.textfield.widget import IRichTextWidget as patextfield_IRichTextWidget # noqa
from z3c.form.interfaces import IFormLayer
from z3c.form.interfaces import ISelectWidget as IBaseSelectWidget
from z3c.form.interfaces import IFormLayer
from z3c.form.interfaces import ITextWidget
from zope.schema.interfaces import IDate
from zope.schema.interfaces import IDatetime
Expand Down
3 changes: 3 additions & 0 deletions plone/app/z3cform/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,12 @@ def test_converter_List_of_Choice(self):
List(),
List(value_type=TextLine()),
List(value_type=BytesLine()),
List(value_type=Choice(values=['one', 'two', 'three']))
)
for field in fields:
expected_value_type = getattr(field.value_type, '_type', unicode)
if expected_value_type is None:
expected_value_type = unicode
widget = Mock(separator=';')
converter = RelatedItemsDataConverter(field, widget)

Expand Down
4 changes: 2 additions & 2 deletions plone/app/z3cform/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from lxml import etree
from plone.app.textfield.value import RichTextValue
from plone.app.textfield.widget import RichTextWidget as patext_RichTextWidget
from plone.app.widgets.base import SelectWidget as BaseSelectWidget
from plone.app.widgets.base import dict_merge
from plone.app.widgets.base import InputWidget
from plone.app.widgets.base import SelectWidget as BaseSelectWidget
from plone.app.widgets.base import TextareaWidget
from plone.app.widgets.utils import NotImplemented as PatternNotImplemented
from plone.app.widgets.utils import first_weekday
from plone.app.widgets.utils import get_ajaxselect_options
from plone.app.widgets.utils import get_date_options
Expand All @@ -15,7 +16,6 @@
from plone.app.widgets.utils import get_relateditems_options
from plone.app.widgets.utils import get_tinymce_options
from plone.app.widgets.utils import get_widget_form
from plone.app.widgets.utils import NotImplemented as PatternNotImplemented
from plone.app.z3cform.converters import DatetimeWidgetConverter
from plone.app.z3cform.converters import DateWidgetConverter
from plone.app.z3cform.interfaces import IAjaxSelectWidget
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()


version = '2.2.dev0'
version = '2.2.1.dev0'


long_description = (
Expand Down

0 comments on commit 68e84fa

Please sign in to comment.