Ejemplo n.º 1
0
    def __call__(self, context):
        settings = IFeedSettings(context)
        wrapped = ImplicitAcquisitionWrapper(self, settings)

        generator = wrapped.get_terms()
        terms = tuple(generator)
        return SimpleVocabulary(terms)
Ejemplo n.º 2
0
    def __call__(self, context):

        try:
            utility = getUtility(IApiUtility, context=context)
        except ComponentLookupError:
            site = getSite()
            utility = getUtility(IApiUtility, context=site)
        else:
            utility = utility.__of__(context)

        wrapped = ImplicitAcquisitionWrapper(self, utility)

        generator = wrapped.get_terms()
        terms = tuple(generator)

        try:
            return SimpleVocabulary(terms)
        except ValueError as e:
            logger.info(e.message)
            return SimpleVocabulary([])
    def __call__(self, context):

        try:
            utility = getUtility(IApiUtility, context=context)
        except ComponentLookupError:
            site = getSite()
            utility = getUtility(IApiUtility, context=site)
        else:
            utility = utility.__of__(context)

        wrapped = ImplicitAcquisitionWrapper(self, utility)

        generator = wrapped.get_terms()
        terms = tuple(generator)

        try:
            return SimpleVocabulary(terms)
        except ValueError as e:
            logger.info(e.message)
            return SimpleVocabulary([])