Skip to content

Commit

Permalink
Add BBB adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Sep 16, 2024
1 parent 54ce09d commit bc626b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plone/app/z3cform/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from plone.app.z3cform.interfaces import IDateWidget
from plone.app.z3cform.interfaces import ILinkWidget
from plone.app.z3cform.interfaces import IQueryStringWidget
from plone.app.z3cform.interfaces import IRelatedItemsWidget
from plone.app.z3cform.interfaces import ISelectWidget
from plone.app.z3cform.interfaces import ISingleCheckBoxBoolWidget
from plone.app.z3cform.interfaces import ITimeWidget
Expand Down Expand Up @@ -329,6 +330,7 @@ def toFieldValue(self, value):


# BBB
@adapter(IRelation, IRelatedItemsWidget)
class RelationChoiceRelatedItemsWidgetConverter(
RelationChoiceContentBrowserWidgetConverter
):
Expand Down Expand Up @@ -413,6 +415,7 @@ def toFieldValue(self, value):


# BBB
@adapter(ICollection, IRelatedItemsWidget)
class RelatedItemsDataConverter(ContentBrowserDataConverter):
"""backwards compatibility"""

Expand Down
4 changes: 4 additions & 0 deletions plone/app/z3cform/converters.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
/>
<adapter factory=".converters.RelationListSelectWidgetDataConverter" />
<adapter factory=".converters.LinkWidgetDataConverter" />

<!-- BBB -->
<adapter factory=".converters.RelationChoiceRelatedItemsWidgetConverter" />
<adapter factory=".converters.RelatedItemsDataConverter" />
</configure>

0 comments on commit bc626b5

Please sign in to comment.