Skip to content

Commit

Permalink
fix fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Aug 18, 2024
1 parent f06f231 commit bc13d1e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 24 deletions.
10 changes: 5 additions & 5 deletions src/iosanita/contenttypes/behaviors/multi_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
class IMultiFileSchema(model.Schema):
""""""

file_principale = field.NamedBlobFile(
title=_("file_principale_label", default="Vai al documento"),
file = field.NamedBlobFile(
title=_("file_label", default="File principale"),
description=_(
"file_principale_help",
"file_help",
default="Inserisci il file principale di questo contenuto.",
),
required=True,
Expand All @@ -41,13 +41,13 @@ class IMultiFileSchema(model.Schema):
required=False,
)

model.primary("file_principale")
model.primary("file")

model.fieldset(
"formati",
label=_("formati_label", default="Formati"),
fields=[
"file_principale",
"file",
"formato_alternativo_1",
"formato_alternativo_2",
],
Expand Down
9 changes: 0 additions & 9 deletions src/iosanita/contenttypes/interfaces/documento.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ class IDocumento(model.Schema, IIosanitaContenttypes):
),
)

# formati_alternativi = BlocksField(
# title=_("formati_alternativi_label", default="Formati disponibili"),
# description=_(
# "formati_alternativi_help",
# default="Lista dei formati in cui è disponibile il documento",
# ),
# required=True,
# )

servizio_procedura_riferimento = RelationList(
title=_(
"servizio_procedura_riferimento_label",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,12 @@ msgstr ""

#. Default: "Inserisci il file principale di questo contenuto."
#: iosanita/contenttypes/behaviors/multi_file.py:17
msgid "file_principale_help"
msgid "file_help"
msgstr ""

#. Default: "Vai al documento"
#: iosanita/contenttypes/behaviors/multi_file.py:16
msgid "file_principale_label"
msgid "file_label"
msgstr ""

#. Default: "Formati"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,12 @@ msgstr ""

#. Default: "Inserisci il file principale di questo contenuto."
#: iosanita/contenttypes/behaviors/multi_file.py:17
msgid "file_principale_help"
msgid "file_help"
msgstr ""

#. Default: "Vai al documento"
#: iosanita/contenttypes/behaviors/multi_file.py:16
msgid "file_principale_label"
msgid "file_label"
msgstr ""

#. Default: "Formati"
Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/locales/iosanita.contenttypes.pot
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,12 @@ msgstr ""

#. Default: "Inserisci il file principale di questo contenuto."
#: iosanita/contenttypes/behaviors/multi_file.py:17
msgid "file_principale_help"
msgid "file_help"
msgstr ""

#. Default: "Vai al documento"
#: iosanita/contenttypes/behaviors/multi_file.py:16
msgid "file_principale_label"
msgid "file_label"
msgstr ""

#. Default: "Formati"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,12 @@ msgstr ""

#. Default: "Inserisci il file principale di questo contenuto."
#: iosanita/contenttypes/behaviors/multi_file.py:17
msgid "file_principale_help"
msgid "file_help"
msgstr ""

#. Default: "Vai al documento"
#: iosanita/contenttypes/behaviors/multi_file.py:16
msgid "file_principale_label"
msgid "file_label"
msgstr ""

#. Default: "Formati"
Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/tests/test_ct_documento.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_documento_required_fields(self):
"title",
"descrizione_estesa",
"uo_correlata",
"file_principale",
"file",
# "description", is required from schema_tweaks.py but it doesn't apply in test
]
),
Expand Down Expand Up @@ -123,7 +123,7 @@ def test_documento_formati_fieldset(self):
resp = self.api_session.get("@types/Documento").json()
self.assertEqual(
resp["fieldsets"][1]["fields"],
["file_principale", "formato_alternativo_1", "formato_alternativo_2"],
["file", "formato_alternativo_1", "formato_alternativo_2"],
)

def test_documento_cosa_e_fieldset(self):
Expand Down

0 comments on commit bc13d1e

Please sign in to comment.