Exemplo n.º 1
0
    def __call__(self, context):
        """ Look for an enclosing program
            list available languages in it """
        terms = []
        program = get_enclosing_program(context)
        if program:
            languages = program.languages
            for language in languages:
                term = (language, language, language)
                terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Exemplo n.º 2
0
    def __call__(self, context):
        """ Look for an enclosing program
            list available rooms in it """
        normalizer = queryUtility(IIDNormalizer)
        terms = []
        program = get_enclosing_program(context)
        if program:
            rooms = program.rooms
            for room in rooms:
                room_id = normalizer.normalize(room)
                term = (room, room_id, room)
                terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Exemplo n.º 3
0
    def __call__(self, context):
        """ Look for an enclosing program
            list available tracks inside it """
        terms = []
        program = get_enclosing_program(context)
        if program:
            program_path = "/".join(program.getPhysicalPath())
            ct = getToolByName(context, "portal_catalog")
            results = ct.searchResults(portal_type="conference.program.track", path=program_path)
            for brain in results:
                term = (brain.UID, brain.UID, brain.Title)
                terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)