Skip to content

Commit b99c9cb

Browse files
committed
fix: change relationchoice for relationlist
1 parent 9ebfc27 commit b99c9cb

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/cs_dynamicpages/adapters/patterns.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
"""
99

10-
from ..behaviors.related_image import IImageRelationChoice
10+
from ..behaviors.related_image import IImageRelationList
1111
from plone import api
1212

1313

@@ -31,7 +31,7 @@
3131
Interface, # IContentListingMarker in the original
3232
Interface, # IRequest in the original
3333
Interface, # IForm in the original
34-
IImageRelationChoice,
34+
IImageRelationList,
3535
IContentBrowserWidget,
3636
)
3737
class RelatedImageContentbrowserPatternOptions:
@@ -45,7 +45,6 @@ def __init__(self, context, request, form, field, widget):
4545
self.widget = widget
4646

4747
def get(self):
48-
4948
return {
5049
"recentlyUsed": True,
5150
"selectableTypes": api.portal.get_registry_record("plone.image_objects"),

src/cs_dynamicpages/behaviors/related_image.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
)
3131

3232

33-
class IImageRelationChoice(Interface):
33+
class IImageRelationList(Interface):
3434
pass
3535

3636

37-
@implementer(IImageRelationChoice)
38-
class ImageRelationChoice(RelationChoice):
37+
@implementer(IImageRelationList)
38+
class ImageRelationList(RelationList):
3939
pass
4040

4141

@@ -47,12 +47,12 @@ class IRelatedImageMarker(Interface):
4747
class IRelatedImage(model.Schema):
4848
""" """
4949

50-
related_image = RelationList(
50+
related_image = ImageRelationList(
5151
title=_("Related image"),
5252
description=_("Select the related image that will be shown in this row"),
5353
default=[],
5454
max_length=1,
55-
value_type=ImageRelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
55+
value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
5656
required=False,
5757
)
5858

0 commit comments

Comments
 (0)