Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set field as primary, so we call @@download on the content, that fil… #268

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading