]> git.parisson.com Git - mezzo.git/commitdiff
[Home] add person on slider
authorEmilie <zawadzki@ircam.fr>
Tue, 7 Feb 2017 14:13:01 +0000 (15:13 +0100)
committerEmilie <zawadzki@ircam.fr>
Tue, 7 Feb 2017 14:13:01 +0000 (15:13 +0100)
app/organization/pages/forms.py
app/organization/pages/views.py
app/settings.py

index a3512c81f30aa1cb37e9c4e008de149201c2f2ea..2b1332744880ed4f6581e70f4093cb1a548ade6e 100644 (file)
@@ -33,6 +33,7 @@ from organization.pages.models import CustomPage
 from organization.pages.models import *
 from organization.agenda.models import Event
 from organization.media.models import Playlist
+from organization.network.models import Person
 
 
 class DynamicContentHomeSliderForm(autocomplete.FutureModelForm):
@@ -41,7 +42,8 @@ class DynamicContentHomeSliderForm(autocomplete.FutureModelForm):
         queryset=autocomplete.QuerySetSequence(
             Article.objects.all(),
             CustomPage.objects.all(),
-            Event.objects.all()
+            Event.objects.all(),
+            Person.objects.published()
         ),
         required=False,
         widget=dal_select2_queryset_sequence.widgets.QuerySetSequenceSelect2('dynamic-content-home-slider'),
index 6d0e61187e5ffbddbc68ce8644fbeae36550364d..e7618946e1bae6e67821eb5fd41a5409d9c2f651 100644 (file)
@@ -34,6 +34,8 @@ from organization.magazine.models import Article, Topic, Brief
 from organization.pages.models import Home
 from organization.agenda.models import Event
 from organization.media.models import Playlist
+from organization.network.models import Person
+
 
 class HomeView(SlugMixin, ListView):
 
@@ -61,13 +63,16 @@ class DynamicContentHomeSliderView(Select2QuerySetSequenceView):
         articles = Article.objects.all()
         custompage = CustomPage.objects.all()
         events = Event.objects.all()
+        persons = Person.objects.published()
+
 
         if self.q:
             articles = articles.filter(title__icontains=self.q)
             custompage = custompage.filter(title__icontains=self.q)
             events = events.filter(title__icontains=self.q)
+            persons = persons.filter(title__icontains=self.q)
 
-        qs = autocomplete.QuerySetSequence(articles, custompage, events)
+        qs = autocomplete.QuerySetSequence(articles, custompage, events, persons)
 
         if self.q:
             # This would apply the filter on all the querysets
@@ -166,4 +171,4 @@ class DynamicContentPageView(Select2QuerySetSequenceView):
 
     def get_results(self, context):
         results = autocomplete_result_formatting(self, context)
-        return results    
+        return results
index c1a24abf6547e5222fa51c94449543eccabf2b48..3a84f1a01be025745843627e8ebec58eb7f12dc7 100644 (file)
@@ -138,7 +138,7 @@ LOCALE_PATHS = ['locale',]
 SESSION_EXPIRE_AT_BROWSER_CLOSE = False
 SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
 
-SITE_ID = 1
+SITE_ID = 3
 
 # If you set this to False, Django will make some optimizations so as not
 # to load the internationalization machinery.