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
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