Guest User

Untitled

a guest
Aug 8th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. class ProjectsVocabulary(object):
  2. interface.implements(IContextSourceBinder)
  3.  
  4. def __call__(self, context):
  5. terms = []
  6. catalog = getToolByName(context, 'portal_catalog') query = {}
  7. query["portal_type"] = 'Project'
  8. results = catalog(query)
  9. for project in results:
  10. terms.append(
  11. SimpleVocabulary.createTerm(
  12. project.project_id,
  13. str(project.project_id),
  14. project.title
  15. )
  16. )
  17. return SimpleVocabulary(terms)
Advertisement
Add Comment
Please, Sign In to add comment