From: Emilie Date: Fri, 4 Nov 2016 17:26:04 +0000 (+0100) Subject: Event: restrict models X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7b5b6dd92d2f27f68ade697307d28bd65f61d5b9;p=mezzo.git Event: restrict models --- diff --git a/app/organization/agenda/forms.py b/app/organization/agenda/forms.py index acb87d20..96f60207 100644 --- a/app/organization/agenda/forms.py +++ b/app/organization/agenda/forms.py @@ -20,9 +20,7 @@ class DynamicContentEventForm(autocomplete.FutureModelForm): content_object = dal_queryset_sequence.fields.QuerySetSequenceModelField( queryset=autocomplete.QuerySetSequence( Article.objects.all(), - CustomPage.objects.all(), - TeamPage.objects.all(), - Project.objects.all() + CustomPage.objects.all() ), required=False, widget=dal_select2_queryset_sequence.widgets.QuerySetSequenceSelect2('dynamic-content-event'), diff --git a/app/organization/agenda/views.py b/app/organization/agenda/views.py index 44abc5df..03d85d5e 100644 --- a/app/organization/agenda/views.py +++ b/app/organization/agenda/views.py @@ -25,17 +25,13 @@ class DynamicContentEventView(Select2QuerySetSequenceView): articles = Article.objects.all() custompage = CustomPage.objects.all() events = Event.objects.all() - teampages = TeamPage.objects.all() - projects = Project.objects.all() if self.q: articles = articles.filter(title__icontains=self.q) custompage = custompage.filter(title__icontains=self.q) events = events.filter(title__icontains=self.q) - teampages = teampages.filter(title__icontains=self.q) - projects = projects.filter(title__icontains=self.q) - qs = autocomplete.QuerySetSequence(articles, custompage, events, teampages, projects) + qs = autocomplete.QuerySetSequence(articles, custompage, events,) if self.q: # This would apply the filter on all the querysets