def __init__(self, context, request, settings):
        super(StandardRecipientSourceForm, self).__init__(context, request)

        self.required = []
        self.optional = []
        for id, r in settings:
            s = recipient_label(r)
            if r['optional']:
                self.optional.append((id, s))
            else:
                self.required.append(s)
 def get_label(self, settings):
     label = u''
     label = recipient_label(settings)
     if settings['optional']:
         label += u' (optional)'
     return label
 def render_recipients_list(self):
     recipients = []
     for _, source in getAdapters((self.context, self.request), IRecipientSource):
         for recipient in source.lookup():
             recipients.append(recipient_label(recipient))
     return recipients