Skip to content

Commit

Permalink
Set field as primary, so we call @@Download on the content, that fil… (
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk authored Jun 27, 2024
1 parent 4b4fc91 commit 9cc2b87
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
6.2.13 (unreleased)
-------------------

- Nothing changed yet.
- Set `file_principale` field as primary, so we call @@download on the content, that file will be downloaded automatically.
[cekk]


6.2.12 (2024-06-24)
Expand Down
2 changes: 2 additions & 0 deletions src/design/plone/contenttypes/behaviors/multi_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class IMultiFileSchema(model.Schema):
required=False,
)

model.primary("file_principale")


@provider(IFormFieldProvider)
class IMultiFile(IMultiFileSchema):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def __call__(self, version=None, include_items=True):
@adapter(IDexterityContainer, IDesignPloneContenttypesLayer)
class SerializeFolderToJson(BaseFolderSerializer, MetaTypeSerializer):
def __call__(self, version=None, include_items=True):

result = super(SerializeFolderToJson, self).__call__(
version=version, include_items=include_items
)
Expand Down
6 changes: 5 additions & 1 deletion src/design/plone/contenttypes/upgrades/to_730x.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ def to_7304(context):

def to_7305(context):
mapping = SUBFOLDERS_MAPPING["Servizio"]
mapping = [folder for folder in mapping.get('content') if folder["id"] == "modulistica"][0] # noqa
mapping = [
folder for folder in mapping.get("content") if folder["id"] == "modulistica"
][
0
] # noqa
brains = api.content.find(portal_type="Servizio")
tot = len(brains)
i = 0
Expand Down

0 comments on commit 9cc2b87

Please sign in to comment.