diff --git a/backend/src/plone/edu/behaviors/configure.zcml b/backend/src/plone/edu/behaviors/configure.zcml index 4ea6b2c..01af7dc 100644 --- a/backend/src/plone/edu/behaviors/configure.zcml +++ b/backend/src/plone/edu/behaviors/configure.zcml @@ -18,4 +18,4 @@ description="Fields with education person information" provides=".eduperson.IEduPersonData" /> - \ No newline at end of file + diff --git a/backend/src/plone/edu/behaviors/eduperson.py b/backend/src/plone/edu/behaviors/eduperson.py index 79452ec..b10eb89 100644 --- a/backend/src/plone/edu/behaviors/eduperson.py +++ b/backend/src/plone/edu/behaviors/eduperson.py @@ -7,23 +7,28 @@ from zope.interface import provider from zope.schema import TextLine - import json + AFFILIATION_SCHEMA = json.dumps( { - 'type': 'object', - 'properties': {'items': {'type': 'array', 'items': {'type': 'object', 'properties': {}}}}, + "type": "object", + "properties": { + "items": {"type": "array", "items": {"type": "object", "properties": {}}} + }, } ) + @provider(IFormFieldProvider) class IEduPersonData(model.Schema): """A Person in context of educational institutions.""" academic_title = TextLine( title=_("label_academic_title", default="Academic title"), - description=_("help_academic_title", default="The academic titles of the person."), + description=_( + "help_academic_title", default="The academic titles of the person." + ), required=False, ) @@ -33,11 +38,11 @@ class IEduPersonData(model.Schema): required=False, ) - affiliation = JSONField( - title='Mixedfield: datagrid field for Plone', + affiliations = JSONField( + title=_("label_affiliations", default="Affiliations"), required=False, schema=AFFILIATION_SCHEMA, - widget='affiliation_widget', - default={'items': []}, - missing_value={'items': []}, + widget="affiliation_widget", + default={"items": []}, + missing_value={"items": []}, ) diff --git a/backend/src/plone/edu/profiles/default/types/Person.xml b/backend/src/plone/edu/profiles/default/types/Person.xml index e3490ef..7b23120 100644 --- a/backend/src/plone/edu/profiles/default/types/Person.xml +++ b/backend/src/plone/edu/profiles/default/types/Person.xml @@ -1,7 +1,12 @@ - - - - + + + + -