]> git.parisson.com Git - mezzo.git/commitdiff
Event: restrict models
authorEmilie <zawadzki@ircam.fr>
Fri, 4 Nov 2016 17:26:04 +0000 (18:26 +0100)
committerEmilie <zawadzki@ircam.fr>
Fri, 4 Nov 2016 17:26:04 +0000 (18:26 +0100)
app/organization/agenda/forms.py
app/organization/agenda/views.py

index acb87d2087c6c6e391a398c749b35503aabdbf89..96f6020740f978725ae1a34828da9305ffabc508 100644 (file)
@@ -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'),
index 44abc5dfca0010b5d19086122542d61f8d0a439f..03d85d5ebaf1843888275054814186c453dc701d 100644 (file)
@@ -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