--- a/src/pyams_content/component/gallery/__init__.py Fri Sep 14 14:25:28 2018 +0200
+++ b/src/pyams_content/component/gallery/__init__.py Mon Sep 17 17:37:46 2018 +0200
@@ -15,35 +15,34 @@
# import standard library
-# import interfaces
-from pyams_content.component.gallery.interfaces import IBaseGallery, IGallery, IGalleryTarget, \
- GALLERY_CONTAINER_KEY, GALLERY_RENDERERS
-from pyams_content.component.paragraph import IBaseParagraph
-from pyams_content.features.checker.interfaces import IContentChecker
-from pyams_content.shared.common.interfaces import IWfSharedContent
-from pyams_form.interfaces.form import IFormContextPermissionChecker
-from pyams_i18n.interfaces import II18n
+from pyramid.events import subscriber
+from pyramid.threadlocal import get_current_registry
+from zope.interface import implementer
+from zope.lifecycleevent import ObjectModifiedEvent
from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent, IObjectRemovedEvent
+from zope.location import locate
from zope.location.interfaces import ISublocations
+from zope.schema.fieldproperty import FieldProperty
from zope.traversing.interfaces import ITraversable
# import packages
from pyams_catalog.utils import index_object
+from pyams_content import _
+# import interfaces
+from pyams_content.component.gallery.interfaces import IBaseGallery, IGallery, IGalleryTarget, IGalleryFile, \
+ GALLERY_CONTAINER_KEY, GALLERY_RENDERERS
+from pyams_content.component.paragraph import IBaseParagraph
from pyams_content.features.checker import BaseContentChecker
+from pyams_content.features.checker.interfaces import IContentChecker
from pyams_content.features.renderer import RenderedContentMixin, RenderersVocabulary
+from pyams_content.shared.common.interfaces import IWfSharedContent
+from pyams_form.interfaces.form import IFormContextPermissionChecker
+from pyams_i18n.interfaces import II18n
from pyams_utils.adapter import adapter_config, ContextAdapter, get_annotation_adapter
+from pyams_utils.container import BTreeOrderedContainer
from pyams_utils.factory import factory_config
-from pyams_utils.container import BTreeOrderedContainer
from pyams_utils.traversing import get_parent
from pyams_utils.vocabulary import vocabulary_config
-from pyramid.events import subscriber
-from pyramid.threadlocal import get_current_registry
-from zope.interface import implementer
-from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
-from zope.location import locate
-from zope.schema.fieldproperty import FieldProperty
-
-from pyams_content import _
#
@@ -73,7 +72,7 @@
index_object(value)
def get_visible_medias(self):
- return [media for media in self.values() if media.visible]
+ yield from filter(lambda x: IGalleryFile(x).visible, self.values())
@adapter_config(context=IGalleryTarget, provides=IGallery)