|
|
|
|
@ -103,8 +103,6 @@ class ContactSettingsForm(forms.ModelForm): |
|
|
|
|
return Theme.objects.none() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ContactFilterForm(forms.Form): |
|
|
|
|
email = forms.EmailField( |
|
|
|
|
label="Email", |
|
|
|
|
@ -132,8 +130,8 @@ class ContactFilterForm(forms.Form): |
|
|
|
|
label="Area", choices=[(c.id, c.name) for c in list(set(Area.objects.language()))], |
|
|
|
|
required=False |
|
|
|
|
) |
|
|
|
|
mailinglist = forms.ChoiceField( |
|
|
|
|
choices=[("", "---")]+[(ml.id, ml.name) for ml in MailingList.objects.all()], |
|
|
|
|
mailinglist = forms.ModelChoiceField( |
|
|
|
|
queryset=MailingList.objects.all(), |
|
|
|
|
label="Список рассылки", |
|
|
|
|
required=False |
|
|
|
|
) |
|
|
|
|
@ -147,8 +145,8 @@ class ContactFilterForm(forms.Form): |
|
|
|
|
title = u'contact list ' |
|
|
|
|
qs = Contact.objects.all().select_related('contactsettings') |
|
|
|
|
if self.cleaned_data.get('mailinglist'): |
|
|
|
|
qs = qs.filter(mailinglist_subscriber__id=self.cleaned_data['mailinglist']) |
|
|
|
|
title += u" mailinglist: %s" % MailingList.objects.get(id=self.cleaned_data['mailinglist']).name |
|
|
|
|
qs = qs.filter(mailinglist_subscriber__id=self.cleaned_data['mailinglist'].pk) |
|
|
|
|
title += u" mailinglist: %s" % self.cleaned_data['mailinglist'].name |
|
|
|
|
|
|
|
|
|
if self.cleaned_data.get('country'): |
|
|
|
|
qs = qs.filter(contactsettings__country__id__in=self.cleaned_data['country']) |
|
|
|
|
|