forked from DGNum/gestioCOF
adding argumement hidden
to Article
in order to avoid some articles to appear in the menu
This commit is contained in:
parent
3ca38bd8e9
commit
aa1afccf1f
4 changed files with 28 additions and 7 deletions
|
@ -48,12 +48,10 @@ class Home(TemplateView):
|
|||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(TemplateView, self).get_context_data(**kwargs)
|
||||
articles = Article.objects.all()
|
||||
context['pressions'] = (articles.filter(category__name='Pression')
|
||||
.filter(is_sold=True))
|
||||
articles = Article.objects.all().filter(is_sold=True, hidden=False)
|
||||
context['pressions'] = articles.filter(category__name='Pression')
|
||||
context['articles'] = (articles.exclude(category__name='Pression')
|
||||
.filter(is_sold=True)
|
||||
.order_by('category'))
|
||||
.order_by('category'))
|
||||
return context
|
||||
|
||||
@method_decorator(login_required)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue