This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
collective.dms.mailcontent/src/collective/dms/mailcontent/vocabulary.py

21 lines
578 B
Python

from five import grok
from zope.schema.vocabulary import SimpleVocabulary
from zope.schema.interfaces import IVocabularyFactory
from . import _
class SendingTypes(grok.GlobalUtility):
grok.name("SendingTypes")
grok.implements(IVocabularyFactory)
def __call__(self, context):
terms = []
types = [('normal', _("Normal")),
('registered', _("Registered"))]
for (token, value) in types:
term = SimpleVocabulary.createTerm(token, token, value)
terms.append(term)
return SimpleVocabulary(terms)