Source code for tagit.controller.sidebox.tags

"""

Part of the tagit module.
A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2016

"""
# IMPORTS

# INNER-MODULE IMPORTS
from ..controller import DataController
from ...basics import union

# EXPORTS
__all__ = ('CSidebox_Tags', )

## CODE ##

[docs]class CSidebox_Tags(DataController): """Base class for tag-oriented sideboxes. """ def _tags_from_images(self, images): """Get and return tags of all *images*.""" try: tags = [self.model.tags.get(img) for img in images] return union(*tags) except IndexError: return [] ## EOF ##