# HG changeset patch # User Thierry Florac # Date 1543329358 -3600 # Node ID 7f0cb6e407fc7f24d3684067e63ae6611de1a899 # Parent de6e9b0637b6f386fa391fafcf75f1ba8616044b Updated vocabulary names diff -r de6e9b0637b6 -r 7f0cb6e407fc src/pyams_content/component/paragraph/interfaces/__init__.py --- a/src/pyams_content/component/paragraph/interfaces/__init__.py Tue Nov 27 15:35:22 2018 +0100 +++ b/src/pyams_content/component/paragraph/interfaces/__init__.py Tue Nov 27 15:35:58 2018 +0100 @@ -12,21 +12,18 @@ __docformat__ = 'restructuredtext' - -# import standard library - from zope.annotation.interfaces import IAttributeAnnotatable from zope.container.constraints import containers, contains from zope.container.interfaces import IOrderedContainer from zope.contentprovider.interfaces import IContentProvider -from zope.interface import Interface, Attribute -from zope.schema import Bool, List, Choice, Set +from zope.interface import Attribute, Interface +from zope.schema import Bool, Choice, List, Set + +from pyams_content.features.renderer import IRenderedContent +from pyams_i18n.schema import I18nTextLineField from pyams_content import _ -# import interfaces -from pyams_content.features.renderer import IRenderedContent -# import packages -from pyams_i18n.schema import I18nTextLineField + PARAGRAPH_CONTAINER_KEY = 'pyams_content.paragraph' @@ -56,6 +53,10 @@ PARAGRAPH_HIDDEN_FIELDS = ('__parent__', '__name__', 'visible', 'anchor') +class IParagraphTitle(Interface): + """Paragraph title adapter""" + + class IParagraphContainer(IOrderedContainer): """Paragraphs container""" @@ -68,6 +69,9 @@ """Get visible paragraphs matching given arguments""" +CONTENT_PARAGRAPHS_VOCABULARY = 'PyAMS content paragraphs' + + class IParagraphContainerTarget(IAttributeAnnotatable): """Paragraphs container marker interface""" @@ -92,7 +96,7 @@ allowed_paragraphs = Set(title=_("Allowed paragraphs"), description=_("List of paragraphs allowed for this content type"), required=False, - value_type=Choice(vocabulary='PyAMS paragraph factories')) + value_type=Choice(vocabulary=PARAGRAPH_FACTORIES_VOCABULARY)) auto_created_paragraphs = List(title=_("Default paragraphs"), description=_("List of paragraphs automatically added to a new content"), diff -r de6e9b0637b6 -r 7f0cb6e407fc src/pyams_content/component/paragraph/interfaces/milestone.py --- a/src/pyams_content/component/paragraph/interfaces/milestone.py Tue Nov 27 15:35:22 2018 +0100 +++ b/src/pyams_content/component/paragraph/interfaces/milestone.py Tue Nov 27 15:35:58 2018 +0100 @@ -17,7 +17,7 @@ from zope.interface import Attribute, Interface from zope.schema import Bool, Choice -from pyams_content.component.paragraph import IBaseParagraph +from pyams_content.component.paragraph import CONTENT_PARAGRAPHS_VOCABULARY, IBaseParagraph from pyams_content.interfaces.container import IOrderedContainer from pyams_i18n.schema import I18nTextField, I18nTextLineField @@ -47,7 +47,7 @@ anchor = Choice(title=_("Anchor"), description=_("Paragraph to which this milestone should lead"), - vocabulary='PyAMS content paragraphs', + vocabulary=CONTENT_PARAGRAPHS_VOCABULARY, required=False) target = Attribute("Anchor target") diff -r de6e9b0637b6 -r 7f0cb6e407fc src/pyams_content/component/paragraph/portlet/interfaces.py --- a/src/pyams_content/component/paragraph/portlet/interfaces.py Tue Nov 27 15:35:22 2018 +0100 +++ b/src/pyams_content/component/paragraph/portlet/interfaces.py Tue Nov 27 15:35:58 2018 +0100 @@ -12,17 +12,14 @@ __docformat__ = 'restructuredtext' - -# import standard library - -# import packages from zope.schema import Bool, Choice, List, Set -from pyams_content import _ -# import interfaces +from pyams_content.component.paragraph import CONTENT_PARAGRAPHS_VOCABULARY from pyams_content.component.paragraph.interfaces import PARAGRAPH_FACTORIES_VOCABULARY from pyams_portal.interfaces import IPortletSettings +from pyams_content import _ + class IParagraphContainerPortletSettings(IPortletSettings): """Paragraphs container portlet settings interface""" @@ -31,7 +28,7 @@ description=_("List of selected paragraphs; an empty selection means that " "all paragraphs will be selectable by following filters; otherwise, " "this selection will have priority"), - value_type=Choice(vocabulary='PyAMS content paragraphs'), + value_type=Choice(vocabulary=CONTENT_PARAGRAPHS_VOCABULARY), required=False) factories = Set(title=_("Paragraph types"), @@ -53,7 +50,7 @@ description=_("List of paragraphs selected for navigation; an empty selection means that " "all paragraphs will be selectable by following filters; otherwise, " "this selection will have priority"), - value_type=Choice(vocabulary='PyAMS content paragraphs'), + value_type=Choice(vocabulary=CONTENT_PARAGRAPHS_VOCABULARY), required=False) factories = Set(title=_("Paragraph types"),