Commit e5edfcef authored by Simon Daron's avatar Simon Daron
Browse files

Focus news are real focus

parent 65ff5cbe
...@@ -375,7 +375,7 @@ class Home(TemplateView): ...@@ -375,7 +375,7 @@ class Home(TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(Home, self).get_context_data(**kwargs) context = super(Home, self).get_context_data(**kwargs)
context['sectionName'] = "Home" context['sectionName'] = "Home"
context['focus'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9]) context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9])
context['emissions'] = list(Emission.objects.filter(archived=False).order_by('title')) context['emissions'] = list(Emission.objects.filter(archived=False).order_by('title'))
schedules = Schedule.objects.select_related().order_by('datetime') schedules = Schedule.objects.select_related().order_by('datetime')
days = [] days = []
...@@ -414,7 +414,7 @@ class NewsItemView(DetailView): ...@@ -414,7 +414,7 @@ class NewsItemView(DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(NewsItemView, self).get_context_data(**kwargs) context = super(NewsItemView, self).get_context_data(**kwargs)
context['sectionName'] = "News" context['sectionName'] = "News"
context['focus'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9]) context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9])
context['categories'] = NewsCategory.objects.all() context['categories'] = NewsCategory.objects.all()
return context return context
newsitemview = NewsItemView.as_view() newsitemview = NewsItemView.as_view()
...@@ -424,8 +424,8 @@ class News(TemplateView): ...@@ -424,8 +424,8 @@ class News(TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(News, self).get_context_data(**kwargs) context = super(News, self).get_context_data(**kwargs)
context['sectionName'] = "News" context['sectionName'] = "News"
context['focus'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9]) context['focus'] = list(NewsItem.objects.all().filter(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[0:9])
context['news'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[3:45]) context['news'] = list(NewsItem.objects.all().exclude(focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[3:45])
context['categories'] = NewsCategory.objects.all() context['categories'] = NewsCategory.objects.all()
return context return context
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment