コード例 #1
0
    def __call__(self, context):
        catalog = api.portal.get_tool('portal_catalog')
        style_template_brains = catalog(portal_type='StyleTemplate')
        voc_terms = [SimpleTerm('--NOVALUE--', '--NOVALUE--', _z3c_form('No value'))]

        for brain in style_template_brains:
            voc_terms.append(SimpleTerm(brain.UID,
                                        brain.UID,
                                        self._renderTermTitle(brain)))

        vocabulary = SimpleVocabulary(voc_terms)

        return vocabulary
コード例 #2
0
    def __call__(self, context):
        catalog = api.portal.get_tool('portal_catalog')
        style_template_brains = catalog(portal_type='StyleTemplate')
        voc_terms = [SimpleTerm('--NOVALUE--', '--NOVALUE--', _z3c_form('No value'))]

        for brain in style_template_brains:
            voc_terms.append(SimpleTerm(brain.UID,
                                        brain.UID,
                                        self._renderTermTitle(brain)))

        vocabulary = SimpleVocabulary(voc_terms)

        return vocabulary
コード例 #3
0
    def __call__(self, context):
        catalog = api.portal.get_tool('portal_catalog')
        pod_templates = catalog(
            portal_type=self._portal_types(),
            sort_on='sortable_title',
            sort_order='ascending',
        )
        voc_terms = [SimpleTerm('--NOVALUE--', '--NOVALUE--', _z3c_form('No value'))]

        for brain in pod_templates:
            voc_terms.append(SimpleTerm(brain.UID, brain.UID, self._render_term_title(brain)))

        vocabulary = SimpleVocabulary(voc_terms)

        return vocabulary
コード例 #4
0
    def __call__(self, context):
        catalog = api.portal.get_tool('portal_catalog')
        pod_templates = catalog(
            portal_type=self._portal_types(),
            sort_on='sortable_title',
            sort_order='ascending',
        )
        voc_terms = [SimpleTerm('--NOVALUE--', '--NOVALUE--', _z3c_form('No value'))]

        for brain in pod_templates:
            voc_terms.append(SimpleTerm(brain.UID, brain.UID, self._render_term_title(brain)))

        vocabulary = SimpleVocabulary(voc_terms)

        return vocabulary