def __init__(self, email, *args, **kwargs): super(Compose, self).__init__(*args, **kwargs) subscribed_lists, other_lists = getListOfLists(email) CHOICES = () for lst in subscribed_lists: #list name and list address CHOICES = CHOICES + ((lst[1],lst[0]),) self.fields['recipient'] = forms.ChoiceField(choices=CHOICES) self.fields.keyOrder = ['recipient', 'subject', 'message']
def __init__(self, email, *args, **kwargs): super(ArchiveRenderer, self).__init__(*args, **kwargs) subscribed_lists, other_lists = getListOfLists(email) CHOICES = () for lst in subscribed_lists: #list name and list address CHOICES = CHOICES + ((lst[1],lst[0]),) self.fields['listnames'] = forms.ChoiceField(choices=CHOICES) self.fields.keyOrder = ['listnames', 'from_date', 'to_date']
def lists(request): ''' View for rendering all available lists ''' subscribed_lists, other_lists = mmclient.getListOfLists(request.user.email) return render_to_response('lists.html', {'subscribed_lists':subscribed_lists, 'other_lists':other_lists}, context_instance=RequestContext(request))