Good afternoon, below is the code from views.py which does a selection of all the articles in the section. But if the articles are tied to a child section, then nothing is selected. How can I select all articles on the root section to select all of all child sections ???
def article_section(request, category_slug=None): category = None object_list = Article.objects.all() if category_slug: category = get_object_or_404(Category, slug=category_slug) object_list = object_list.filter(category=category) paginator = Paginator(object_list, 3) page = request.GET.get('page') sections = Category.objects.all() try: articles = paginator.page(page) except PageNotAnInteger: articles = paginator.page(1) except EmptyPage: articles = paginator.page(paginator.num_pages) return render( request, 'articles/list.html', { 'page': page, 'category': category, 'sections': sections, 'articles': articles, } )