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):
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'),
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):
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
def get_results(self, context):
results = autocomplete_result_formatting(self, context)
- return results
+ return results
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.