def __call__(self, context): registry = getUtility(IRegistry) settings = registry.forInterface(INITFSettings) items = [] if settings.possible_genres: for genre in settings.possible_genres: token = unicodedata.normalize('NFKD', genre).encode('ascii', 'ignore').lower() items.append(SimpleVocabulary.createTerm(genre, token, _(genre))) return SimpleVocabulary(items)
# -*- coding: utf-8 -*- PROJECTNAME = "collective.nitf.core" CONTROLPANEL_ID = "nitf-settings" from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm from collective.nitf.core import _ # this cames from http://cv.iptc.org/newscodes/genre/ GENRES = SimpleVocabulary( [ SimpleTerm(value=u"Actuality", title=_(u"Actuality")), # Definition: The object contains the recording of the event. SimpleTerm(value=u"Advice", title=_(u"Advice")), # Definition: The object contains advice, typically letters and answers about personal problems, that are publishable. SimpleTerm(value=u"Almanac", title=_(u"Almanac")), # Definition: List of data, including birthdays of famous people and items of historical significance, for a given day. SimpleTerm(value=u"Analysis", title=_(u"Analysis")), # Definition: The object contains data and conclusions drawn by a journalist who has researched the story in depth. SimpleTerm(value=u"Anniversary", title=_(u"Anniversary")), # Definition: Stories about the anniversary of some important event that took place in recent history, usually bringing a short review of the event itself. SimpleTerm(value=u"Archive material", title=_(u"Archive material")), # Definition: The object contains material distributed previously that has been selected from the originator's archives. SimpleTerm(value=u"Background", title=_(u"Background")), # Definition: The object provides some scene setting and explanation for the event being reported. SimpleTerm(value=u"Current", title=_(u"Current")), # Definition: The object content is about events taking place at the time of the report. SimpleTerm(value=u"Curtain Raiser", title=_(u"Curtain Raiser")), # Definition: The object contains information about the staging and outcome of an immediately upcoming event. SimpleTerm(value=u"Daybook", title=_(u"Daybook")),