Skip to content

Commit

Permalink
WIP: expand_items persona
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Jun 19, 2024
1 parent 839e66b commit 83fc64f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/design/plone/contenttypes/interfaces/persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class IPersona(model.Schema, IDesignPloneContentType):
required=False,
description=_(
"atto_nomina_help",
default="Inserire un file contenente l'atto di nomina della" " persona.",
default="Inserire un file contenente l'atto di nomina della persona.",
),
)

Expand Down
7 changes: 7 additions & 0 deletions src/design/plone/contenttypes/restapi/serializers/persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def related_contents(self, field):
return sorted(items, key=lambda k: k["title"])

def __call__(self, version=None, include_items=True):
# useful if you want to have (i.e. fullobject of childrens by default)
# TODO: add behavior and field for manage attribute TTW (actually managed only
# by code)
if getattr(self.context, "expand_items", None):
self.request.form["fullobjects"] = "1"

result = super(PersonaSerializer, self).__call__(
version=version, include_items=include_items
)
Expand All @@ -53,4 +59,5 @@ def __call__(self, version=None, include_items=True):
result["responsabile_di"] = responsabile_di
if assessore_di:
result["assessore_di"] = assessore_di

return result

0 comments on commit 83fc64f

Please sign in to comment.