]> git.parisson.com Git - mezzo.git/commitdiff
Autocomplete : commenting event
authorEmilie <zawadzki@ircam.fr>
Wed, 24 Aug 2016 14:41:13 +0000 (16:41 +0200)
committerEmilie <zawadzki@ircam.fr>
Wed, 24 Aug 2016 14:41:13 +0000 (16:41 +0200)
app/organization/pages/forms.py
app/organization/pages/views.py

index 763576ceb4975ac0da95df3eab44825710f6b59c..12be7870f0c5f14116c08396c8231cc94fb963d6 100644 (file)
@@ -5,7 +5,7 @@ import dal_select2_queryset_sequence
 from mezzanine.core.models import Orderable
 from organization.magazine.models import Article, Topic, Brief
 from organization.pages.models import CustomPage
-from mezzanine_agenda.models import Event
+from mezzanine_agenda.models import Event
 from organization.pages.models import DynamicContentHomeSlider, DynamicContentHomeBody
 
 class DynamicContentHomeSliderForm(autocomplete.FutureModelForm):
@@ -13,7 +13,7 @@ class DynamicContentHomeSliderForm(autocomplete.FutureModelForm):
     content_object = dal_queryset_sequence.fields.QuerySetSequenceModelField(
         queryset=autocomplete.QuerySetSequence(
             Article.objects.all(),
-            Event.objects.all(),
+            Event.objects.all(),
             CustomPage.objects.all(),
         ),
         required=False,
@@ -33,7 +33,7 @@ class DynamicContentHomeBodyForm(autocomplete.FutureModelForm):
     content_object = dal_queryset_sequence.fields.QuerySetSequenceModelField(
         queryset=autocomplete.QuerySetSequence(
             Article.objects.all(),
-            Event.objects.all(),
+            Event.objects.all(),
             CustomPage.objects.all(),
             Brief.objects.all(),
         ),
index c36f2b17b387a894e2fbefecd13a5bea8fc463d7..c4018bcac87e35d9ca0de1be4d19af21bcfacd24 100644 (file)
@@ -2,7 +2,7 @@ from django.shortcuts import render
 from django.views.generic import DetailView, ListView, TemplateView
 from dal import autocomplete
 from dal_select2_queryset_sequence.views import Select2QuerySetSequenceView
-from mezzanine_agenda.models import Event
+from mezzanine_agenda.models import Event
 from organization.pages.models import CustomPage
 from organization.core.views import SlugMixin
 from organization.magazine.models import Article, Topic, Brief
@@ -34,14 +34,14 @@ class DynamicContentHomeSliderView(Select2QuerySetSequenceView):
 
         articles = Article.objects.all()
         custompage = CustomPage.objects.all()
-        events = Event.objects.all()
+        events = Event.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)
+            events = events.filter(title__icontains=self.q)
 
-        qs = autocomplete.QuerySetSequence(articles, custompage, events )
+        qs = autocomplete.QuerySetSequence(articles, custompage ) #, events
 
         if self.q:
             # This would apply the filter on all the querysets
@@ -58,16 +58,16 @@ class DynamicContentHomeBodyView(Select2QuerySetSequenceView):
 
         articles = Article.objects.all()
         custompage = CustomPage.objects.all()
-        events = Event.objects.all()
+        events = Event.objects.all()
         briefs = Brief.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)
+            events = events.filter(title__icontains=self.q)
             briefs = briefs.filter(title__icontains=self.q)
 
-        qs = autocomplete.QuerySetSequence(articles, custompage, events, briefs)
+        qs = autocomplete.QuerySetSequence(articles, custompage, briefs) #, events
 
         if self.q:
             # This would apply the filter on all the querysets