-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from eea/develop
feat(serializer): added effective to the default_metadata_fields
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Summary serializer metadata for EEA Volto Policy.""" | ||
from plone.restapi.interfaces import IJSONSummarySerializerMetadata | ||
from plone.restapi.serializer.summary import JSONSummarySerializerMetadata | ||
from zope.interface import implementer | ||
|
||
|
||
@implementer(IJSONSummarySerializerMetadata) | ||
class EEAJSONSummarySerializerMetadata(JSONSummarySerializerMetadata): | ||
""" | ||
Summary Metadata serializer inherited within EEA Volto Policy. | ||
Implements IJSONSummarySerializerMetadata interface. | ||
""" | ||
|
||
def default_metadata_fields(self): | ||
""" | ||
Returns a set of default metadata fields to be included in the summary. | ||
We add effective date to the list of default fields. | ||
Returns: | ||
set: A set of metadata field names. | ||
""" | ||
return { | ||
"@id", | ||
"@type", | ||
"description", | ||
"review_state", | ||
"title", | ||
"type_title", | ||
"effective", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.4 | ||
3.5 |