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

WIP: expand_items persona #267

Draft
wants to merge 1 commit into
base: v5.x
Choose a base branch
from
Draft
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
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
Loading